From 9c7b2ed4b841b22ba83a7d57af44bc87b4dfbcf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Wed, 8 Mar 2017 15:52:59 +0100 Subject: [PATCH] Sdk/World: Fix entity ids being reused before destruction --- SDK/src/NDK/World.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SDK/src/NDK/World.cpp b/SDK/src/NDK/World.cpp index 545fab499..cad4660d4 100644 --- a/SDK/src/NDK/World.cpp +++ b/SDK/src/NDK/World.cpp @@ -185,12 +185,12 @@ namespace Ndk NazaraAssert(entity.IsValid(), "Entity must be valid"); - // Send back the identifier of the entity to the free queue - m_freeIdList.push_back(entity.GetId()); - // Destruction of the entity (invalidation of handle by the same way) entity.Destroy(); + // Send back the identifier of the entity to the free queue + m_freeIdList.push_back(entity.GetId()); + // We take out the handle from the list of alive entities // With the idiom swap and pop