diff options
Diffstat (limited to 'src/game/GameObject.cpp')
-rw-r--r-- | src/game/GameObject.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index da6ab1ef12d..01383ade0b3 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -1442,6 +1442,7 @@ void GameObject::TakenDamage(uint32 damage) SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED); SetUInt32Value(GAMEOBJECT_DISPLAYID, m_goInfo->destructibleBuilding.destroyedDisplayId); m_goValue->destructibleBuilding.health = 0; + EventInform(m_goInfo->destructibleBuilding.destroyedEventId); } else // from undamaged to damaged { @@ -1455,6 +1456,7 @@ void GameObject::TakenDamage(uint32 damage) } else m_goValue->destructibleBuilding.health = 0; + EventInform(m_goInfo->destructibleBuilding.damagedEventId); } } @@ -1465,6 +1467,12 @@ void GameObject::Rebuild() m_goValue->destructibleBuilding.health = m_goInfo->destructibleBuilding.damagedHealth; } +void GameObject::EventInform(uint32 eventId) +{ + if(eventId && m_zoneScript) + m_zoneScript->ProcessEvent(this, eventId); +} + // overwrite WorldObject function for proper name localization const char* GameObject::GetNameForLocaleIdx(int32 loc_idx) const { |