Added m_IsFlying and m_CanFly. Both have a Get and Set function. Added cClientHandle::SendPlayerAbilities() function
This commit is contained in:
@@ -491,7 +491,15 @@ void cProtocol172::SendPlayerAbilities(void)
|
||||
{
|
||||
Flags |= 0x01;
|
||||
}
|
||||
// TODO: Other flags (god mode, flying, can fly
|
||||
if (m_Client->GetPlayer()->IsFlying())
|
||||
{
|
||||
Flags |= 0x02;
|
||||
}
|
||||
if (m_Client->GetPlayer()->CanFly())
|
||||
{
|
||||
Flags |= 0x04;
|
||||
}
|
||||
// TODO: Other flags (god mode)
|
||||
Pkt.WriteByte(Flags);
|
||||
// TODO: Pkt.WriteFloat(m_Client->GetPlayer()->GetMaxFlyingSpeed());
|
||||
Pkt.WriteFloat(0.05f);
|
||||
@@ -1278,7 +1286,7 @@ void cProtocol172::HandlePacketPlayerAbilities(cByteBuffer & a_ByteBuffer)
|
||||
HANDLE_READ(a_ByteBuffer, ReadByte, Byte, Flags);
|
||||
HANDLE_READ(a_ByteBuffer, ReadBEFloat, float, FlyingSpeed);
|
||||
HANDLE_READ(a_ByteBuffer, ReadBEFloat, float, WalkingSpeed);
|
||||
// TODO: m_Client->HandlePlayerAbilities();
|
||||
m_Client->HandlePlayerAbilities(Flags, FlyingSpeed, WalkingSpeed);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user