fix: player timed events not carrying over between maps (#106)

This commit is contained in:
Rochet2
2023-03-09 13:16:27 +02:00
committed by GitHub
parent 39c4117927
commit 554bf506c5

View File

@@ -901,18 +901,10 @@ public:
void OnWorldObjectSetMap(WorldObject* object, Map* /*map*/) override void OnWorldObjectSetMap(WorldObject* object, Map* /*map*/) override
{ {
delete object->elunaEvents; if (!object->elunaEvents)
// On multithread replace this with a pointer to map's Eluna pointer stored in a map
object->elunaEvents = new ElunaEventProcessor(&Eluna::GEluna, object); object->elunaEvents = new ElunaEventProcessor(&Eluna::GEluna, object);
} }
void OnWorldObjectResetMap(WorldObject* object) override
{
delete object->elunaEvents;
object->elunaEvents = nullptr;
}
void OnWorldObjectUpdate(WorldObject* object, uint32 diff) override void OnWorldObjectUpdate(WorldObject* object, uint32 diff) override
{ {
object->elunaEvents->Update(diff); object->elunaEvents->Update(diff);