check for non-item asset
parent
f6bc4d3d44
commit
428e59c69e
|
@ -1,11 +1,14 @@
|
|||
#include "assets.h"
|
||||
|
||||
#define ASSET_TEX(asset)\
|
||||
#define ASSET_ENTRY(asset, asset_kind)\
|
||||
{\
|
||||
.id = asset,\
|
||||
.kind = AKIND_TEXTURE,\
|
||||
.kind = asset_kind,\
|
||||
}
|
||||
|
||||
#define ASSET_SND(asset) ASSET_ENTRY(asset, AKIND_SOUND)
|
||||
#define ASSET_TEX(asset) ASSET_ENTRY(asset, AKIND_TEXTURE)
|
||||
|
||||
static asset assets[] = {
|
||||
ASSET_TEX(ASSET_EMPTY),
|
||||
ASSET_TEX(ASSET_DEMO_ICEMAKER),
|
||||
|
|
|
@ -85,7 +85,7 @@ ActEraseWorldChanges(void) {
|
|||
|
||||
if (l.is_outer && l.block_id > 0) {
|
||||
asset_id item_asset = blocks_get_asset(l.block_id);
|
||||
if (item_asset == ASSET_INVALID) continue;
|
||||
if (item_find(item_asset) == ASSET_INVALID) continue;
|
||||
uint64_t e = item_spawn(item_asset, 1);
|
||||
|
||||
Position *dest = ecs_get_mut(world_ecs(), e, Position, NULL);
|
||||
|
|
|
@ -42,7 +42,6 @@ uint16_t item_find(asset_id kind) {
|
|||
if (items[i].kind == kind)
|
||||
return item_resolve_proxy(i);
|
||||
}
|
||||
|
||||
return ASSET_INVALID;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue