Fixed double deletion check assert
This commit is contained in:
@@ -605,6 +605,7 @@ void BuildingsData::item_nodes_delete_node(const String &key)
|
||||
|
||||
void BuildingsData::item_nodes_item_removed(const String &key)
|
||||
{
|
||||
/* FIXME: pretty sure this is redundant */
|
||||
flecs::query_builder<const CBuildingInstance> qb =
|
||||
ecs.query_builder<const CBuildingInstance>();
|
||||
flecs::query<const CBuildingInstance> q = qb.build();
|
||||
@@ -612,7 +613,8 @@ void BuildingsData::item_nodes_item_removed(const String &key)
|
||||
flecs::entity e = q.find([key_hash](const CBuildingInstance &bi) {
|
||||
return bi.key.hash64() == key_hash;
|
||||
});
|
||||
assert(e.is_valid());
|
||||
if (!e.is_valid())
|
||||
return;
|
||||
CBuildingInstance *bi = e.get_mut<CBuildingInstance>();
|
||||
assert(bi);
|
||||
if (bi->node) {
|
||||
|
||||
Reference in New Issue
Block a user