Sdk/World: Fix entity ids being reused before destruction

This commit is contained in:
Jérôme Leclercq 2017-03-08 15:52:59 +01:00
parent b0d61802b6
commit 9c7b2ed4b8
1 changed files with 3 additions and 3 deletions

View File

@ -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