Merge branch 'master' of github.com:azerothcore/azerothcore-wotlk into Playerbot

This commit is contained in:
Yunfan Li
2023-10-22 19:52:23 +08:00
203 changed files with 7031 additions and 2667 deletions

View File

@@ -2280,7 +2280,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)