feat(Core/GameObject): Implement OnGameObjectModifyHealth() hook (#17374)
This commit is contained in:
parent
2779833768
commit
c25d0b38e8
3 changed files with 30 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue