summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/cClientHandle.cpp4
-rw-r--r--source/cClientHandle.h1
-rw-r--r--source/cPlayer.cpp12
3 files changed, 9 insertions, 8 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index 9b1e886dd..c5c6dbd20 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -482,10 +482,10 @@ void cClientHandle::HandlePacket( cPacket* a_Packet )
cWorld* World = cRoot::Get()->GetWorld();
char OldBlock = World->GetBlock(PacketData->m_PosX, PacketData->m_PosY, PacketData->m_PosZ);
char MetaData = World->GetBlockMeta(PacketData->m_PosX, PacketData->m_PosY, PacketData->m_PosZ);
- bool bBroken = (PacketData->m_Status == 0x02) || g_BlockOneHitDig[(int)OldBlock] || ( (PacketData->m_Status == 0x00) && (GAMEMODE == 1) ); //need to change to check for client's gamemode.
+ bool bBroken = (PacketData->m_Status == 0x02) || g_BlockOneHitDig[(int)OldBlock] || ( (PacketData->m_Status == 0x00) && (cPacket::GAMEMODE == 1) ); //need to change to check for client's gamemode.
cItem PickupItem;
- if( bBroken && !(GAMEMODE == 1) ) // broken
+ if( bBroken && !(cPacket::GAMEMODE == 1) ) // broken
{
ENUM_ITEM_ID PickupID = cBlockToPickup::ToPickup( (ENUM_BLOCK_ID)OldBlock, m_Player->GetInventory().GetEquippedItem().m_ItemID );
PickupItem.m_ItemID = PickupID;
diff --git a/source/cClientHandle.h b/source/cClientHandle.h
index a704ffc0e..224ba46b3 100644
--- a/source/cClientHandle.h
+++ b/source/cClientHandle.h
@@ -20,7 +20,6 @@ public:
~cClientHandle();
static const int VIEWDISTANCE = 13;
- static const int GAMEMODE = 1; //0 = Survival, 1 = Creative;
const cSocket & GetSocket();
cPlayer* GetPlayer() { return m_Player; } // tolua_export
diff --git a/source/cPlayer.cpp b/source/cPlayer.cpp
index 71fa41d27..21c08fc5a 100644
--- a/source/cPlayer.cpp
+++ b/source/cPlayer.cpp
@@ -317,11 +317,13 @@ void cPlayer::Heal( int a_Health )
void cPlayer::TakeDamage( int a_Damage, cEntity* a_Instigator )
{
- cPawn::TakeDamage( a_Damage, a_Instigator );
+ if ( !(cPacket::GAMEMODE == 1) ) {
+ cPawn::TakeDamage( a_Damage, a_Instigator );
- cPacket_UpdateHealth Health;
- Health.m_Health = m_Health;
- m_ClientHandle->Send( Health );
+ cPacket_UpdateHealth Health;
+ Health.m_Health = m_Health;
+ m_ClientHandle->Send( Health );
+ }
}
void cPlayer::KilledBy( cEntity* a_Killer )
@@ -711,4 +713,4 @@ void cPlayer::SetName( const char* a_Name )
const cPlayer::GroupList & cPlayer::GetGroups()
{
return m_pState->Groups;
-} \ No newline at end of file
+}