Skip to content

Commit

Permalink
style(core): add curly braces to if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
SrGesus committed Oct 21, 2024
1 parent 6153891 commit 538ed14
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions core/src/ecs/world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ void World::destroy(Entity entity)
columnId = mArchetypeGraph.next(archetype, columnId))
{
// Trigger any observers that are interested in this change.
if (mObservers->notifyRemove(cmdBuffer, entity, columnId))
if (mObservers->notifyRemove(cmdBuffer, entity, columnId)) {
observed = true;
}
}

// Remove entity from the pool and from its dense table.
Expand Down Expand Up @@ -213,8 +214,9 @@ void World::destroy(Entity entity)
}

// Run commands from observers after entity is destroyed
if (observed)
if (observed) {
cmdBuffer.commit();
}

CUBOS_DEBUG("Destroyed entity {}", entity);
}
Expand Down Expand Up @@ -812,8 +814,9 @@ auto World::Components::remove(const reflection::Type& type) -> Components&
// Trigger any observers that are interested in this change.
CommandBuffer cmdBuffer{mWorld};
bool observed = false;
if (mWorld.mObservers->notifyRemove(cmdBuffer, mEntity, columnId))
if (mWorld.mObservers->notifyRemove(cmdBuffer, mEntity, columnId)) {
observed = true;
}

auto& oldTable = mWorld.mTables.dense().at(oldArchetype);

Expand All @@ -833,8 +836,9 @@ auto World::Components::remove(const reflection::Type& type) -> Components&
CUBOS_TRACE("Removed component {} from entity {}", type.name(), mEntity);

// Run commands from observers after component is removed
if (observed)
if (observed) {
cmdBuffer.commit();
}

return *this;
}
Expand Down

0 comments on commit 538ed14

Please sign in to comment.