summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authoradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-11-11 01:21:52 +0100
committeradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-11-11 01:21:52 +0100
commit750f9ab74fa7dfb04739dd5dd9d8a3fb4976b901 (patch)
tree47472736034c0755da129f97a66c1a15d12755ff /source
parentFixed logging in underground bug this time. A hack, but it works. :D (diff)
downloadcuberite-750f9ab74fa7dfb04739dd5dd9d8a3fb4976b901.tar
cuberite-750f9ab74fa7dfb04739dd5dd9d8a3fb4976b901.tar.gz
cuberite-750f9ab74fa7dfb04739dd5dd9d8a3fb4976b901.tar.bz2
cuberite-750f9ab74fa7dfb04739dd5dd9d8a3fb4976b901.tar.lz
cuberite-750f9ab74fa7dfb04739dd5dd9d8a3fb4976b901.tar.xz
cuberite-750f9ab74fa7dfb04739dd5dd9d8a3fb4976b901.tar.zst
cuberite-750f9ab74fa7dfb04739dd5dd9d8a3fb4976b901.zip
Diffstat (limited to 'source')
-rw-r--r--source/cClientHandle.cpp9
-rw-r--r--source/cClientHandle.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index a399441de..d41759d09 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -695,8 +695,10 @@ void cClientHandle::HandlePacket( cPacket* a_Packet )
bool bPlaceBlock = true;
bool UpdateRedstone = false;
bool AddedCurrent = false;
+
if( PacketData->m_Direction >= 0 )
{
+
ENUM_BLOCK_ID BlockID = (ENUM_BLOCK_ID)m_Player->GetWorld()->GetBlock( PacketData->m_PosX, PacketData->m_PosY, PacketData->m_PosZ );
switch( BlockID )
{
@@ -814,6 +816,7 @@ void cClientHandle::HandlePacket( cPacket* a_Packet )
char MetaData = (char)Equipped.m_ItemHealth;
bool LavaBucket = false;
bool WaterBucket = false;
+
switch( PacketData->m_ItemType ) // Special handling for special items
{
case E_ITEM_BUCKET:
@@ -947,10 +950,12 @@ void cClientHandle::HandlePacket( cPacket* a_Packet )
char Y = PacketData->m_PosY;
int Z = PacketData->m_PosZ;
AddDirection( X, Y, Z, PacketData->m_Direction );
- if( m_Player->GetWorld()->GetBlock( X, Y, Z ) != E_BLOCK_AIR ) { //tried to place a block *into* another?
+
+ int PlaceBlock = m_Player->GetWorld()->GetBlock( X, Y, Z );
+ if (!( ( PlaceBlock == E_BLOCK_AIR ) || ( PlaceBlock == E_BLOCK_WATER ) || ( PlaceBlock == E_BLOCK_STATIONARY_WATER ) || ( PlaceBlock == E_BLOCK_LAVA ) || ( PlaceBlock == E_BLOCK_STATIONARY_LAVA ) ) ) { //tried to place a block *into* another?
break; //happens when you place a block aiming at side of block like torch or stem
}
-
+
if( (m_Player->GetGameMode() == 1) || (m_Player->GetInventory().RemoveItem( Item )) )
{
if (isDoor) {
diff --git a/source/cClientHandle.h b/source/cClientHandle.h
index 5025f03d2..e38165604 100644
--- a/source/cClientHandle.h
+++ b/source/cClientHandle.h
@@ -20,7 +20,7 @@ public:
cClientHandle(const cSocket & a_Socket);
~cClientHandle();
- static const int VIEWDISTANCE = 13;
+ static const int VIEWDISTANCE = 17;
const cSocket & GetSocket();
cPlayer* GetPlayer() { return m_Player; } // tolua_export