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:
+7
-2
@@ -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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user