06-26-2015, 09:16 AM
My proposal is this: cChunk::m_Entites should own the player objects, and cWorld::m_Players and cClientHandle::m_Player should be a weak reference to the object, or even just entity IDs. If we go for weak references, I'll have to write a custom smart pointer, because the std::lib types don't support what we would want to do. Alternatively, if we go for IDs we probably need to improve The performance of DoWithEntityById, because at the moment its O(C + E), where C is the number of loaded chunks, and E is the number of entities in the world.