summaryrefslogtreecommitdiffstats
path: root/source/cClientHandle.cpp
diff options
context:
space:
mode:
authoradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-10-26 20:47:50 +0200
committeradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-10-26 20:47:50 +0200
commit7b00d2815765f16b4a5cac8b5d0bf6d13d56acda (patch)
tree057af5ee1604c7a0b8d423bb2d138839762797ca /source/cClientHandle.cpp
parentAdded CreateInventoryAction packet for creative mode. Used cPacketEntityEquipment as template. Forced server into Creative Mode. Can't break blocks yet. Player can stil be damaged in creative mode and dying takes you back to survival mode. (diff)
downloadcuberite-7b00d2815765f16b4a5cac8b5d0bf6d13d56acda.tar
cuberite-7b00d2815765f16b4a5cac8b5d0bf6d13d56acda.tar.gz
cuberite-7b00d2815765f16b4a5cac8b5d0bf6d13d56acda.tar.bz2
cuberite-7b00d2815765f16b4a5cac8b5d0bf6d13d56acda.tar.lz
cuberite-7b00d2815765f16b4a5cac8b5d0bf6d13d56acda.tar.xz
cuberite-7b00d2815765f16b4a5cac8b5d0bf6d13d56acda.tar.zst
cuberite-7b00d2815765f16b4a5cac8b5d0bf6d13d56acda.zip
Diffstat (limited to '')
-rw-r--r--source/cClientHandle.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index f21815e52..9b1e886dd 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -472,7 +472,7 @@ void cClientHandle::HandlePacket( cPacket* a_Packet )
case E_BLOCK_DIG:
{
cPacket_BlockDig* PacketData = reinterpret_cast<cPacket_BlockDig*>(a_Packet);
- //LOG("OnBlockDig: %i %i %i Dir: %i Stat: %i", PacketData->m_PosX, PacketData->m_PosY, PacketData->m_PosZ, PacketData->m_Direction, PacketData->m_Status );
+ LOG("OnBlockDig: %i %i %i Dir: %i Stat: %i", PacketData->m_PosX, PacketData->m_PosY, PacketData->m_PosZ, PacketData->m_Direction, PacketData->m_Status );
if( PacketData->m_Status == 0x04 ) // Drop block
{
m_Player->TossItem( false );
@@ -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];
+ 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.
cItem PickupItem;
- if( bBroken ) // broken
+ if( bBroken && !(GAMEMODE == 1) ) // broken
{
ENUM_ITEM_ID PickupID = cBlockToPickup::ToPickup( (ENUM_BLOCK_ID)OldBlock, m_Player->GetInventory().GetEquippedItem().m_ItemID );
PickupItem.m_ItemID = PickupID;