Made several recomended changes. Gamemode is now world based. Need to add it to player.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@18 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
admin@omencraft.com
2011-10-26 20:52:19 +00:00
parent 6062002d17
commit 88270be669
11 changed files with 26 additions and 19 deletions
+7 -2
View File
@@ -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 );
}