From 538ed140e1c0daf07d5910c9b659625ccda14d5e Mon Sep 17 00:00:00 2001 From: SrGesus <108523575+SrGesus@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:39:02 +0100 Subject: [PATCH] style(core): add curly braces to if statements --- core/src/ecs/world.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/ecs/world.cpp b/core/src/ecs/world.cpp index a0a6bcb87..1fb51573e 100644 --- a/core/src/ecs/world.cpp +++ b/core/src/ecs/world.cpp @@ -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. @@ -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); } @@ -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); @@ -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; }