Core/GameObject: Store unit in GameObject::SetLootState - required for trap activation.

This commit is contained in:
Gacko
2014-05-05 18:39:53 +02:00
parent d0e6693266
commit c6bf7e0b1d
2 changed files with 2 additions and 0 deletions
@@ -2015,6 +2015,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
void GameObject::SetLootState(LootState state, Unit* unit)
{
m_lootState = state;
m_lootStateUnit = unit;
AI()->OnStateChanged(state, unit);
sScriptMgr->OnGameObjectLootStateChanged(this, state, unit);
if (m_model)
@@ -841,6 +841,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map
time_t m_respawnTime; // (secs) time of next respawn (or despawn if GO have owner()),
uint32 m_respawnDelayTime; // (secs) if 0 then current GO state no dependent from timer
LootState m_lootState;
Unit* m_lootStateUnit;
bool m_spawnedByDefault;
time_t m_cooldownTime; // used as internal reaction delay time store (not state change reaction).
// For traps this: spell casting cooldown, for doors/buttons: reset time.