summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-07-01 20:37:27 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-07-01 20:37:27 +0200
commit2e9cf0ae28db267cc4d658d61ee3ce14813bf527 (patch)
treefe9ec9217765db309bcf65c7625d4011f1eb6c64 /source
parentFixed /stop command. The console still doesn't get closed though(FS#249). (diff)
downloadcuberite-2e9cf0ae28db267cc4d658d61ee3ce14813bf527.tar
cuberite-2e9cf0ae28db267cc4d658d61ee3ce14813bf527.tar.gz
cuberite-2e9cf0ae28db267cc4d658d61ee3ce14813bf527.tar.bz2
cuberite-2e9cf0ae28db267cc4d658d61ee3ce14813bf527.tar.lz
cuberite-2e9cf0ae28db267cc4d658d61ee3ce14813bf527.tar.xz
cuberite-2e9cf0ae28db267cc4d658d61ee3ce14813bf527.tar.zst
cuberite-2e9cf0ae28db267cc4d658d61ee3ce14813bf527.zip
Diffstat (limited to 'source')
-rw-r--r--source/Entity.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/source/Entity.cpp b/source/Entity.cpp
index bb65f4358..c80977286 100644
--- a/source/Entity.cpp
+++ b/source/Entity.cpp
@@ -631,6 +631,9 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk)
void cEntity::TickBurning(cChunk & a_Chunk)
{
+ // Remember the current burning state:
+ bool HasBeenBurning = (m_TicksLeftBurning > 0);
+
// Do the burning damage:
if (m_TicksLeftBurning > 0)
{
@@ -638,18 +641,11 @@ void cEntity::TickBurning(cChunk & a_Chunk)
if (m_TicksSinceLastBurnDamage >= BURN_TICKS_PER_DAMAGE)
{
TakeDamage(dtOnFire, NULL, BURN_DAMAGE, 0, 0);
- m_TicksSinceLastFireDamage = 0;
+ m_TicksSinceLastBurnDamage = 0;
}
m_TicksLeftBurning--;
- if (m_TicksLeftBurning == 0)
- {
- OnFinishedBurning();
- }
}
- // Remember the current burning state:
- bool HasBeenBurning = (m_TicksLeftBurning > 0);
-
// Update the burning times, based on surroundings:
int MinRelX = (int)floor(GetPosX() - m_Width / 2) - a_Chunk.GetPosX() * cChunkDef::Width;
int MaxRelX = (int)floor(GetPosX() + m_Width / 2) - a_Chunk.GetPosX() * cChunkDef::Width;
@@ -711,7 +707,7 @@ void cEntity::TickBurning(cChunk & a_Chunk)
// Periodically damage:
m_TicksSinceLastLavaDamage++;
- if (m_TicksSinceLastLavaDamage >= 10)
+ if (m_TicksSinceLastLavaDamage >= LAVA_TICKS_PER_DAMAGE)
{
TakeDamage(dtLavaContact, NULL, LAVA_DAMAGE, 0);
m_TicksSinceLastLavaDamage = 0;
@@ -732,6 +728,7 @@ void cEntity::TickBurning(cChunk & a_Chunk)
if (m_TicksSinceLastFireDamage >= FIRE_TICKS_PER_DAMAGE)
{
TakeDamage(dtFireContact, NULL, FIRE_DAMAGE, 0);
+ m_TicksSinceLastFireDamage = 0;
}
}
else