summaryrefslogtreecommitdiffstats
path: root/src/Protocol
diff options
context:
space:
mode:
Diffstat (limited to 'src/Protocol')
-rw-r--r--src/Protocol/Protocol_1_14.cpp3
-rw-r--r--src/Protocol/Protocol_1_8.cpp15
2 files changed, 10 insertions, 8 deletions
diff --git a/src/Protocol/Protocol_1_14.cpp b/src/Protocol/Protocol_1_14.cpp
index 0d0bc49a0..f38227edd 100644
--- a/src/Protocol/Protocol_1_14.cpp
+++ b/src/Protocol/Protocol_1_14.cpp
@@ -90,9 +90,6 @@ void cProtocol_1_14::SendLogin(const cPlayer & a_Player, const cWorld & a_World)
// cPacketizer Pkt(*this, pktDifficulty);
// Pkt.WriteBEInt8(1);
}
-
- // Send player abilities:
- SendPlayerAbilities();
}
diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp
index d29126e4e..e2e8ca499 100644
--- a/src/Protocol/Protocol_1_8.cpp
+++ b/src/Protocol/Protocol_1_8.cpp
@@ -934,13 +934,12 @@ void cProtocol_1_8_0::SendPlayerAbilities(void)
{
ASSERT(m_State == 3); // In game mode?
- cPacketizer Pkt(*this, pktPlayerAbilities);
Byte Flags = 0;
- cPlayer * Player = m_Client->GetPlayer();
- if (Player->IsGameModeCreative())
+ const cPlayer * Player = m_Client->GetPlayer();
+
+ if (Player->IsGameModeCreative() || Player->IsGameModeSpectator())
{
- Flags |= 0x01;
- Flags |= 0x08; // Godmode, used for creative
+ Flags |= 0x01; // Invulnerability.
}
if (Player->IsFlying())
{
@@ -950,6 +949,12 @@ void cProtocol_1_8_0::SendPlayerAbilities(void)
{
Flags |= 0x04;
}
+ if (Player->IsGameModeCreative())
+ {
+ Flags |= 0x08; // Godmode: creative instant break.
+ }
+
+ cPacketizer Pkt(*this, pktPlayerAbilities);
Pkt.WriteBEUInt8(Flags);
Pkt.WriteBEFloat(static_cast<float>(0.05 * Player->GetFlyingMaxSpeed()));
Pkt.WriteBEFloat(static_cast<float>(0.1 * Player->GetNormalMaxSpeed()));