1
0

Server sends PlayerMaxSpeed after a respawn.

http://forum.mc-server.org/showthread.php?tid=434&pid=8912#pid8912

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1671 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2013-07-08 18:30:27 +00:00
parent 97dc5a5365
commit 94a92a219b
2 changed files with 13 additions and 1 deletions

View File

@ -100,7 +100,7 @@ void cProtocol161::SendHealth(void)
WriteByte (PACKET_UPDATE_HEALTH);
WriteFloat((float)m_Client->GetPlayer()->GetHealth());
WriteShort(m_Client->GetPlayer()->GetFoodLevel());
WriteFloat(m_Client->GetPlayer()->GetFoodSaturationLevel());
WriteFloat((float)m_Client->GetPlayer()->GetFoodSaturationLevel());
Flush();
}
@ -123,6 +123,17 @@ void cProtocol161::SendPlayerMaxSpeed(void)
void cProtocol161::SendRespawn(void)
{
// Besides sending the respawn, we need to also send the player max speed, otherwise the client reverts to super-fast
super::SendRespawn();
SendPlayerMaxSpeed();
}
void cProtocol161::SendWindowOpen(char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots)
{
if (a_WindowType < 0)

View File

@ -38,6 +38,7 @@ protected:
virtual void SendGameMode (eGameMode a_GameMode) override;
virtual void SendHealth (void) override;
virtual void SendPlayerMaxSpeed(void) override;
virtual void SendRespawn (void) override;
virtual void SendWindowOpen (char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots) override;
virtual int ParseEntityAction (void) override;