selected_item bugfix

isolation_bkp/dynres
Dominik Madarász 2021-08-30 17:56:23 +02:00
parent 36232e1e20
commit 32deb322db
2 changed files with 4 additions and 13 deletions

View File

@ -32,8 +32,8 @@ pkt_desc pkt_entity_view_desc[] = {
{ PKT_KEEP_IF(entity_view, has_items, true, 3) },
{ PKT_UINT(entity_view, has_items) },
{ PKT_ARRAY(entity_view, items) },
{ PKT_UINT(entity_view, selected_item) },
{ PKT_ARRAY(entity_view, items) },
{ PKT_END },
};
@ -51,14 +51,6 @@ entity_view entity_view_unpack_struct(void *data, size_t len) {
entity_view view = {0};
pkt_unpack_struct(&uc, pkt_entity_view_desc, PKT_STRUCT_PTR(&view));
#if 0
if (view.kind == EKIND_CHUNK) {
for (int i=0;i<256;i++){
zpl_printf("%d, ", view.blocks[i]);
}
zpl_exit(0);
}
#endif
return view;
}

View File

@ -56,10 +56,6 @@ entity_view world_build_entity_view(int64_t e) {
ItemDrop const* dr = ecs_get(world_ecs(), e, ItemDrop);
view.asset = item_get_asset(dr->kind);
view.quantity = dr->quantity;
const Input *in = ecs_get(world_ecs(), e, Input);
if (in)
view.selected_item = in->selected_item;
}
Inventory *inv = 0;
@ -70,6 +66,9 @@ entity_view world_build_entity_view(int64_t e) {
view.items[i] = inv->items[i];
}
const Input *in = ecs_get(world_ecs(), e, Input);
if (in)
view.selected_item = in->selected_item;
}
Chunk *chpos = 0;