mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 01:29:07 +00:00
feat(Core/GameObject): Implement OnGameObjectModifyHealth() hook (#17374)
This commit is contained in:
@@ -2279,7 +2279,14 @@ void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= nullptr*/
|
||||
if (!IsDestructibleBuilding())
|
||||
return;
|
||||
|
||||
if (!m_goValue.Building.MaxHealth || !change)
|
||||
// if this building doesn't have health, return
|
||||
if (!m_goValue.Building.MaxHealth)
|
||||
return;
|
||||
|
||||
sScriptMgr->OnGameObjectModifyHealth(this, attackerOrHealer, change, sSpellMgr->GetSpellInfo(spellId));
|
||||
|
||||
// if the health isn't being changed, return
|
||||
if (!change)
|
||||
return;
|
||||
|
||||
if (!m_allowModifyDestructibleBuilding)
|
||||
|
||||
Reference in New Issue
Block a user