mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-30 21:57:01 +01:00
Core/Packets: fixed SM SMSG_UPDATE_OBJECT packet structure
This commit is contained in:
@@ -726,9 +726,11 @@ void Object::BuildMovementUpdate(ByteBuffer* data, CreateObjectBits flags, Playe
|
||||
|
||||
bool HasSceneInstanceIDs = !player->GetSceneMgr().GetSceneTemplateByInstanceMap().empty();
|
||||
bool HasRuneState = ToUnit()->GetPowerIndex(POWER_RUNES) != MAX_POWERS;
|
||||
bool HasActionButtons = player->IsLoading();
|
||||
|
||||
data->WriteBit(HasSceneInstanceIDs);
|
||||
data->WriteBit(HasRuneState);
|
||||
data->WriteBit(HasActionButtons);
|
||||
data->FlushBits();
|
||||
if (HasSceneInstanceIDs)
|
||||
{
|
||||
@@ -747,6 +749,18 @@ void Object::BuildMovementUpdate(ByteBuffer* data, CreateObjectBits flags, Playe
|
||||
for (uint32 i = 0; i < maxRunes; ++i)
|
||||
*data << uint8((baseCd - float(player->GetRuneCooldown(i))) / baseCd * 255);
|
||||
}
|
||||
if (HasActionButtons)
|
||||
{
|
||||
ActionButtonList const& actionButtonList = player->GetActionButtons();
|
||||
for (uint8 i = 0; i < MAX_ACTION_BUTTONS; ++i)
|
||||
{
|
||||
auto itr = actionButtonList.find(i);
|
||||
if (itr != actionButtonList.end() && itr->second.uState != ACTIONBUTTON_DELETED)
|
||||
*data << uint32(itr->second.GetAction());
|
||||
else
|
||||
*data << uint32(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flags.Conversation)
|
||||
|
||||
Reference in New Issue
Block a user