From 40727cc0ca10101360bc9b9333e6555bc4a428bc Mon Sep 17 00:00:00 2001 From: Lynix Date: Sat, 14 Mar 2015 13:21:29 +0100 Subject: [PATCH] (World) Fixed EntityHandle passed by value Former-commit-id: c4b4b5cbb4d84110416a4493fc09e7b95e137bc6 --- SDK/include/NDK/World.hpp | 4 ++-- SDK/include/NDK/World.inl | 2 +- SDK/src/NDK/World.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SDK/include/NDK/World.hpp b/SDK/include/NDK/World.hpp index 0f67eb7ef..29f860908 100644 --- a/SDK/include/NDK/World.hpp +++ b/SDK/include/NDK/World.hpp @@ -30,12 +30,12 @@ namespace Ndk void Clear(); - void KillEntity(EntityHandle entity); + void KillEntity(const EntityHandle& entity); void KillEntities(const EntityList& list); EntityHandle GetEntity(Entity::Id id); - bool IsEntityValid(EntityHandle entity) const; + bool IsEntityValid(const EntityHandle& entity) const; bool IsEntityIdValid(Entity::Id id) const; void Update(); diff --git a/SDK/include/NDK/World.inl b/SDK/include/NDK/World.inl index fbffd2c40..0f275872a 100644 --- a/SDK/include/NDK/World.inl +++ b/SDK/include/NDK/World.inl @@ -22,7 +22,7 @@ namespace Ndk KillEntity(entity); } - inline bool World::IsEntityValid(EntityHandle entity) const + inline bool World::IsEntityValid(const EntityHandle& entity) const { return entity.IsValid() && entity->GetWorld() == this && IsEntityIdValid(entity->GetId()); } diff --git a/SDK/src/NDK/World.cpp b/SDK/src/NDK/World.cpp index 38ee525d0..14befe738 100644 --- a/SDK/src/NDK/World.cpp +++ b/SDK/src/NDK/World.cpp @@ -52,7 +52,7 @@ namespace Ndk m_killedEntities.clear(); } - void World::KillEntity(EntityHandle entity) + void World::KillEntity(const EntityHandle& entity) { ///DOC: Ignoré si l'entité est invalide @@ -77,7 +77,7 @@ namespace Ndk { for (unsigned int i = 0; i < m_killedEntities.size(); ++i) { - EntityHandle entity = m_killedEntities[i]; + const EntityHandle& entity = m_killedEntities[i]; for (unsigned int j = 0; j < m_aliveEntities.size(); ++j) {