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)
|
void BuildingsData::item_nodes_item_removed(const String &key)
|
||||||
{
|
{
|
||||||
|
/* FIXME: pretty sure this is redundant */
|
||||||
flecs::query_builder<const CBuildingInstance> qb =
|
flecs::query_builder<const CBuildingInstance> qb =
|
||||||
ecs.query_builder<const CBuildingInstance>();
|
ecs.query_builder<const CBuildingInstance>();
|
||||||
flecs::query<const CBuildingInstance> q = qb.build();
|
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) {
|
flecs::entity e = q.find([key_hash](const CBuildingInstance &bi) {
|
||||||
return bi.key.hash64() == key_hash;
|
return bi.key.hash64() == key_hash;
|
||||||
});
|
});
|
||||||
assert(e.is_valid());
|
if (!e.is_valid())
|
||||||
|
return;
|
||||||
CBuildingInstance *bi = e.get_mut<CBuildingInstance>();
|
CBuildingInstance *bi = e.get_mut<CBuildingInstance>();
|
||||||
assert(bi);
|
assert(bi);
|
||||||
if (bi->node) {
|
if (bi->node) {
|
||||||
|
|||||||
Reference in New Issue
Block a user