From 28b0e26a886eec2a653120fecb45ff7cd9f76181 Mon Sep 17 00:00:00 2001 From: Lynix Date: Tue, 31 Mar 2015 02:20:30 +0200 Subject: [PATCH] (EntityHandle) Fixed hashs Former-commit-id: f5d23d81a5b46dfbf90d2004dfeb9595f30c2df2 --- SDK/include/NDK/EntityHandle.inl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SDK/include/NDK/EntityHandle.inl b/SDK/include/NDK/EntityHandle.inl index 4544a825f..57cbbb2db 100644 --- a/SDK/include/NDK/EntityHandle.inl +++ b/SDK/include/NDK/EntityHandle.inl @@ -3,6 +3,7 @@ // For conditions of distribution and use, see copyright notice in Prerequesites.hpp #include +#include namespace Ndk { @@ -242,7 +243,11 @@ namespace std { size_t operator()(const Ndk::EntityHandle& handle) const { - return hash()(handle.GetEntity()); + // Hasher le pointeur fonctionnerait jusqu'à ce que l'entité soit mise à jour et déplacée + // pour cette raison, nous devons hasher l'ID de l'entité (qui reste constante) + Ndk::EntityId id = (handle.IsValid()) ? handle->GetId() : std::numeric_limits::max(); + + return hash()(id); } };