mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 01:29:07 +00:00
feat(Core/Optimization): Optimize build of units update object by leveraging cache (#18637)
* feat(Core/Optimization): Optimize build of units update object by leveraging cache. * Remove whitespaces. * Add alternative hooks to handle transmog and other similar things. * Fix build on some compilers. * Fix codestyle * Fix build again. * Take into account updateType.
This commit is contained in:
committed by
GitHub
parent
94df67b1c2
commit
1f640c9872
@@ -192,18 +192,24 @@ bool ScriptMgr::IsCustomBuildValuesUpdate(Unit const* unit, uint8 updateType, By
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnBuildValuesUpdate(Unit const* unit, uint8 updateType, ByteBuffer& fieldBuffer, Player* target, uint16 index)
|
||||
bool ScriptMgr::ShouldTrackValuesUpdatePosByIndex(Unit const* unit, uint8 updateType, uint16 index)
|
||||
{
|
||||
auto ret = IsValidBoolScript<UnitScript>([&](UnitScript* script) { return script->OnBuildValuesUpdate(unit, updateType, fieldBuffer, target, index); });
|
||||
auto ret = IsValidBoolScript<UnitScript>([&](UnitScript* script) { return script->ShouldTrackValuesUpdatePosByIndex(unit, updateType, index); });
|
||||
|
||||
if (ret && *ret)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPatchValuesUpdate(Unit const* unit, ByteBuffer& valuesUpdateBuf, BuildValuesCachePosPointers& posPointers, Player* target)
|
||||
{
|
||||
ExecuteScript<UnitScript>([&](UnitScript* script)
|
||||
{
|
||||
script->OnPatchValuesUpdate(unit, valuesUpdateBuf, posPointers, target);
|
||||
});
|
||||
}
|
||||
|
||||
void ScriptMgr::OnUnitUpdate(Unit* unit, uint32 diff)
|
||||
{
|
||||
ExecuteScript<UnitScript>([&](UnitScript* script)
|
||||
|
||||
Reference in New Issue
Block a user