summaryrefslogtreecommitdiffstats
path: root/source/cPlayer.cpp
diff options
context:
space:
mode:
authoradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-10-26 22:52:19 +0200
committeradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-10-26 22:52:19 +0200
commit88270be66928f3b73b73fc1f3b26a74358089223 (patch)
tree736a03b5343df0693638f59b39a9f3599d7d9057 /source/cPlayer.cpp
parentMoved GAMEMODE declaration to a single place... cPacket.h. Player can't take damage any more but can still sometimes die on spawn. Not sure why. Falling through the void does not kill you yet. (diff)
downloadcuberite-88270be66928f3b73b73fc1f3b26a74358089223.tar
cuberite-88270be66928f3b73b73fc1f3b26a74358089223.tar.gz
cuberite-88270be66928f3b73b73fc1f3b26a74358089223.tar.bz2
cuberite-88270be66928f3b73b73fc1f3b26a74358089223.tar.lz
cuberite-88270be66928f3b73b73fc1f3b26a74358089223.tar.xz
cuberite-88270be66928f3b73b73fc1f3b26a74358089223.tar.zst
cuberite-88270be66928f3b73b73fc1f3b26a74358089223.zip
Diffstat (limited to 'source/cPlayer.cpp')
-rw-r--r--source/cPlayer.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/cPlayer.cpp b/source/cPlayer.cpp
index 21c08fc5a..2f7e27988 100644
--- a/source/cPlayer.cpp
+++ b/source/cPlayer.cpp
@@ -317,7 +317,7 @@ void cPlayer::Heal( int a_Health )
void cPlayer::TakeDamage( int a_Damage, cEntity* a_Instigator )
{
- if ( !(cPacket::GAMEMODE == 1) ) {
+ if ( !(cRoot::Get()->GetWorld()->GetGameMode() == 1) ) {
cPawn::TakeDamage( a_Damage, a_Instigator );
cPacket_UpdateHealth Health;
@@ -356,7 +356,12 @@ void cPlayer::Respawn()
m_Health = 20;
cWorld* World = cRoot::Get()->GetWorld();
- m_ClientHandle->Send( cPacket_Respawn() );
+ // Create Respawn player packet
+ cPacket_Respawn Packet;
+ //Set Gamemode for packet by looking at world's gamemode (Need to check players gamemode.)
+ Packet.m_CreativeMode = cRoot::Get()->GetWorld()->GetGameMode();
+ //Send Packet
+ m_ClientHandle->Send( Packet );
TeleportTo( World->GetSpawnX(), World->GetSpawnY(), World->GetSpawnZ() );
SetVisible( true );
}