mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[11543] Fixed change form to same (powershifting)
Inspired by patch provided by darkstalker. Client expected receive form field change at form switing including case with switch to same form. In fact problem too good mangos optimization in part avoid send unchanged values in update fields. * Added function Object::SendForcedObjectUpdate() * It used in form apply code for make sure received by client non-form applied state in middle form shifting state. * It also used for fishing code when client also expected received some update fields chnages before animation update. New function send update to all all client instead before used code that send it to fishing player and resend later one more time to other players and player itself as normal update.
This commit is contained in:
parent
81984732a3
commit
c5b6cc0b37
5 changed files with 50 additions and 31 deletions
|
|
@ -108,6 +108,25 @@ void Object::SetObjectScale(float newScale)
|
|||
SetFloatValue(OBJECT_FIELD_SCALE_X, newScale);
|
||||
}
|
||||
|
||||
void Object::SendForcedObjectUpdate()
|
||||
{
|
||||
if (!m_inWorld || !m_objectUpdated)
|
||||
return;
|
||||
|
||||
UpdateDataMapType update_players;
|
||||
|
||||
BuildUpdateData(update_players);
|
||||
RemoveFromClientUpdateList();
|
||||
|
||||
WorldPacket packet; // here we allocate a std::vector with a size of 0x10000
|
||||
for(UpdateDataMapType::iterator iter = update_players.begin(); iter != update_players.end(); ++iter)
|
||||
{
|
||||
iter->second.BuildPacket(&packet);
|
||||
iter->first->GetSession()->SendPacket(&packet);
|
||||
packet.clear(); // clean the string
|
||||
}
|
||||
}
|
||||
|
||||
void Object::BuildMovementUpdateBlock(UpdateData * data, uint16 flags ) const
|
||||
{
|
||||
ByteBuffer buf(500);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue