mirror of
https://github.com/araxiaonline/azerothshard-core.git
synced 2026-06-13 02:42:24 -04:00
Revert "Core/Hooks: Rewrite hook IsCustomBuildValuesUpdate"
This reverts commit 8fc0abd728.
This commit is contained in:
@@ -19492,8 +19492,9 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
|
||||
else
|
||||
fieldBuffer << (uint32)target->getFaction();
|
||||
}
|
||||
else if (sScriptMgr->CanCustomBuildValuesUpdate(this, updateType, fieldBuffer, target, index))
|
||||
fieldBuffer << m_uint32Values[index];
|
||||
else
|
||||
if (!sScriptMgr->IsCustomBuildValuesUpdate(this, updateType, fieldBuffer, target, index))
|
||||
fieldBuffer << m_uint32Values[index];
|
||||
}
|
||||
else
|
||||
// send in current format (float as float, uint32 as uint32)
|
||||
|
||||
@@ -2570,13 +2570,13 @@ bool ScriptMgr::CanSetPhaseMask(Unit const* unit, uint32 newPhaseMask, bool upda
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool ScriptMgr::CanCustomBuildValuesUpdate(Unit const* unit, uint8 updateType, ByteBuffer& fieldBuffer, Player const* target, uint16 index)
|
||||
bool ScriptMgr::IsCustomBuildValuesUpdate(Unit const* unit, uint8 updateType, ByteBuffer& fieldBuffer, Player const* target, uint16 index)
|
||||
{
|
||||
bool ret = true;
|
||||
bool ret = false;
|
||||
|
||||
FOR_SCRIPTS_RET(UnitScript, itr, end, ret) // return true by default if not scripts
|
||||
if (!itr->second->CanCustomBuildValuesUpdate(unit, updateType, fieldBuffer, target, index))
|
||||
ret = false; // we change ret value only when scripts return true
|
||||
if (itr->second->IsCustomBuildValuesUpdate(unit, updateType, fieldBuffer, target, index))
|
||||
ret = true; // we change ret value only when scripts return true
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -485,7 +485,7 @@ public:
|
||||
|
||||
virtual bool CanSetPhaseMask(Unit const* /*unit*/, uint32 /*newPhaseMask*/, bool /*update*/) { return true; }
|
||||
|
||||
virtual bool CanCustomBuildValuesUpdate(Unit const* /*unit*/, uint8 /*updateType*/, ByteBuffer& /*fieldBuffer*/, Player const* /*target*/, uint16 /*index*/) { return false; }
|
||||
virtual bool IsCustomBuildValuesUpdate(Unit const* /*unit*/, uint8 /*updateType*/, ByteBuffer& /*fieldBuffer*/, Player const* /*target*/, uint16 /*index*/) { return false; }
|
||||
};
|
||||
|
||||
class MovementHandlerScript : public ScriptObject
|
||||
@@ -1806,7 +1806,7 @@ class ScriptMgr
|
||||
bool IsNeedModMeleeDamagePercent(Unit const* unit, AuraEffect* auraEff, float& doneTotalMod, SpellInfo const* spellProto);
|
||||
bool IsNeedModHealPercent(Unit const* unit, AuraEffect* auraEff, float& doneTotalMod, SpellInfo const* spellProto);
|
||||
bool CanSetPhaseMask(Unit const* unit, uint32 newPhaseMask, bool update);
|
||||
bool CanCustomBuildValuesUpdate(Unit const* unit, uint8 updateType, ByteBuffer& fieldBuffer, Player const* target, uint16 index);
|
||||
bool IsCustomBuildValuesUpdate(Unit const* unit, uint8 updateType, ByteBuffer& fieldBuffer, Player const* target, uint16 index);
|
||||
|
||||
public: /* MovementHandlerScript */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user