| @@ -134,6 +134,19 @@ void Dict::RemoveSlot(int id) | |||||
| } | } | ||||
| } | } | ||||
| void Dict::RemoveSlot(Entity *entity) | |||||
| { | |||||
| for (int id = 0; id < data->maxid; id++) | |||||
| if (data->entities[id] == entity) | |||||
| { | |||||
| RemoveSlot(id); | |||||
| return; | |||||
| } | |||||
| #if !LOL_RELEASE | |||||
| Log::Error("removing unregistered entity %p\n", entity); | |||||
| #endif | |||||
| } | |||||
| void Dict::SetEntity(int id, Entity *entity) | void Dict::SetEntity(int id, Entity *entity) | ||||
| { | { | ||||
| @@ -31,6 +31,7 @@ public: | |||||
| int MakeSlot(char const *name); | int MakeSlot(char const *name); | ||||
| void RemoveSlot(int id); | void RemoveSlot(int id); | ||||
| void RemoveSlot(Entity *entity); | |||||
| void SetEntity(int id, Entity *entity); | void SetEntity(int id, Entity *entity); | ||||
| Entity *GetEntity(int id); | Entity *GetEntity(int id); | ||||