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) {