Skip to content

Commit

Permalink
Add Eluna event processor reset
Browse files Browse the repository at this point in the history
Required in those cases where Eluna is not active on some maps for whatever reason
  • Loading branch information
Foereaper authored Feb 25, 2025
1 parent e58b802 commit b4020fa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/server/game/Entities/Object/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1825,8 +1825,12 @@ void WorldObject::SetMap(Map* map)
m_mapId = map->GetId();
m_InstanceId = map->GetInstanceId();
#ifdef ELUNA
// in multistate mode, always reset in case Eluna is not active on the new map
if (elunaEvents && !sElunaConfig->IsElunaCompatibilityMode())
elunaEvents.reset();

if (Eluna* e = map->GetEluna())
if (!elunaEvents || (elunaEvents && !sElunaConfig->IsElunaCompatibilityMode()))
if (!elunaEvents)
elunaEvents = std::make_unique<ElunaEventProcessor>(e, this);
#endif
if (IsStoredInWorldObjectGridContainer())
Expand Down

0 comments on commit b4020fa

Please sign in to comment.