diff options
author | admin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-11-01 18:48:11 +0100 |
---|---|---|
committer | admin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-11-01 18:48:11 +0100 |
commit | 01246b27b00c0dbcb811cd168fcc6b6f85991135 (patch) | |
tree | 30268ec9dbb0e2e4fd4d17df11f2b20d6463c5f0 /source | |
parent | denotch map converter works! :D (diff) | |
download | cuberite-01246b27b00c0dbcb811cd168fcc6b6f85991135.tar cuberite-01246b27b00c0dbcb811cd168fcc6b6f85991135.tar.gz cuberite-01246b27b00c0dbcb811cd168fcc6b6f85991135.tar.bz2 cuberite-01246b27b00c0dbcb811cd168fcc6b6f85991135.tar.lz cuberite-01246b27b00c0dbcb811cd168fcc6b6f85991135.tar.xz cuberite-01246b27b00c0dbcb811cd168fcc6b6f85991135.tar.zst cuberite-01246b27b00c0dbcb811cd168fcc6b6f85991135.zip |
Diffstat (limited to 'source')
-rw-r--r-- | source/cChunkMap.cpp | 1 | ||||
-rw-r--r-- | source/cClientHandle.cpp | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/source/cChunkMap.cpp b/source/cChunkMap.cpp index b5a907f09..1cabcd593 100644 --- a/source/cChunkMap.cpp +++ b/source/cChunkMap.cpp @@ -660,6 +660,7 @@ cChunkMap::cChunkLayer* cChunkMap::LoadLayer(int a_LayerX, int a_LayerZ ) short NumChunks = 0;
if( fread( &NumChunks, sizeof(NumChunks), 1, f) != 1 ) { LOGERROR("ERROR 3 READING FROM FILE %s", SourceFile); fclose(f); return false; }
LOG("Num chunks: %i", NumChunks );
+ LOG("Source File: %s", SourceFile );
cChunkLayer* Layer = new cChunkLayer( LAYER_SIZE*LAYER_SIZE );
Layer->m_X = a_LayerX;
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp index ab7e66786..4c0cefc3e 100644 --- a/source/cClientHandle.cpp +++ b/source/cClientHandle.cpp @@ -581,7 +581,8 @@ void cClientHandle::HandlePacket( cPacket* a_Packet ) {
cPacket_BlockPlace* PacketData = reinterpret_cast<cPacket_BlockPlace*>(a_Packet);
cItem & Equipped = m_Player->GetInventory().GetEquippedItem();
- if( (Equipped.m_ItemID != PacketData->m_ItemType) ) // Not valid
+ //if( (Equipped.m_ItemID != PacketData->m_ItemType) ) // Not valid
+ if( (Equipped.m_ItemID != PacketData->m_ItemType) && (cRoot::Get()->GetWorld()->GetGameMode() != 1) ) // Not valid
{
LOGWARN("Player %s tried to place a block that was not selected! (could indicate bot)", GetUsername() );
break;
@@ -592,7 +593,6 @@ void cClientHandle::HandlePacket( cPacket* a_Packet ) if( PacketData->m_Direction > -1 )
{
AddDirection( PacketData->m_PosX, PacketData->m_PosY, PacketData->m_PosZ, PacketData->m_Direction );
-
m_Player->GetWorld()->SendBlockTo( PacketData->m_PosX, PacketData->m_PosY, PacketData->m_PosZ, m_Player );
}
break;
@@ -721,7 +721,7 @@ void cClientHandle::HandlePacket( cPacket* a_Packet ) if( IsValidBlock( PacketData->m_ItemType) )
{
- if( m_Player->GetInventory().RemoveItem( Item ) )
+ if( (m_Player->GetInventory().RemoveItem( Item )) || (cRoot::Get()->GetWorld()->GetGameMode() == 1) )
{
int X = PacketData->m_PosX;
char Y = PacketData->m_PosY;
|