From 547c34132530a4dba841879595bd0762ef52a22d Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 18 Jun 2013 08:24:34 +0000 Subject: TNT fixes. Other blocks can be placed next to TNT. Explosions activate nearby TNT blocks. TNT doesn't destroy bedrock, obsidian and liquid blocks. Server doesn't crash when a TNT (or other entity) leaves the valid Y range. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1603 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/TNTEntity.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/TNTEntity.cpp') diff --git a/source/TNTEntity.cpp b/source/TNTEntity.cpp index 4541a7c7f..ec4bc6dfa 100644 --- a/source/TNTEntity.cpp +++ b/source/TNTEntity.cpp @@ -41,7 +41,7 @@ void cTNTEntity::Initialize(cWorld * a_World) void cTNTEntity::SpawnOn(cClientHandle & a_ClientHandle) { - a_ClientHandle.SendSpawnObject(*this,50,1,0,0); //50 means TNT + a_ClientHandle.SendSpawnObject(*this, 50, 1, 0, 0); // 50 means TNT m_bDirtyPosition = false; m_bDirtySpeed = false; m_bDirtyOrientation = false; @@ -54,15 +54,15 @@ void cTNTEntity::SpawnOn(cClientHandle & a_ClientHandle) void cTNTEntity::Tick(float a_Dt, cChunk & a_Chunk) { - super::Tick(a_Dt,a_Chunk); + super::Tick(a_Dt, a_Chunk); BroadcastMovementUpdate(); - float delta_time = a_Dt / 1000; //Convert miliseconds to seconds + float delta_time = a_Dt / 1000; // Convert miliseconds to seconds m_Counter += delta_time; - if (m_Counter > m_MaxFuseTime) //Check if we go KABOOOM + if (m_Counter > m_MaxFuseTime) // Check if we go KABOOOM { Destroy(); - LOGD("BOOM at {%f,%f,%f}",GetPosX(),GetPosY(),GetPosZ()); - m_World->DoExplosiontAt(4.0,(int)floor(GetPosX()),(int)floor(GetPosY()),(int)floor(GetPosZ())); + LOGD("BOOM at {%f,%f,%f}", GetPosX(), GetPosY(), GetPosZ()); + m_World->DoExplosiontAt(4.0, (int)floor(GetPosX()), (int)floor(GetPosY()), (int)floor(GetPosZ())); return; } } -- cgit v1.2.3