summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-04-22 15:04:04 +0200
committerMattes D <github@xoft.cz>2014-04-22 15:04:04 +0200
commitb3a9b73278b0fc8a885d7f415d13845c7ffc063a (patch)
treeb0419d9ba01fd65ff30810c1840df14523414832 /src
parentRevert moving gcc to g++11 in 18c3b1 (diff)
parentFixed indentation and changed m_Fireproof to m_IsFireproof. (diff)
downloadcuberite-b3a9b73278b0fc8a885d7f415d13845c7ffc063a.tar
cuberite-b3a9b73278b0fc8a885d7f415d13845c7ffc063a.tar.gz
cuberite-b3a9b73278b0fc8a885d7f415d13845c7ffc063a.tar.bz2
cuberite-b3a9b73278b0fc8a885d7f415d13845c7ffc063a.tar.lz
cuberite-b3a9b73278b0fc8a885d7f415d13845c7ffc063a.tar.xz
cuberite-b3a9b73278b0fc8a885d7f415d13845c7ffc063a.tar.zst
cuberite-b3a9b73278b0fc8a885d7f415d13845c7ffc063a.zip
Diffstat (limited to 'src')
-rw-r--r--src/Entities/Entity.cpp15
-rw-r--r--src/Entities/Entity.h3
2 files changed, 15 insertions, 3 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 56ef36ef8..9a80d3e80 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -788,7 +788,10 @@ void cEntity::TickBurning(cChunk & a_Chunk)
m_TicksSinceLastBurnDamage++;
if (m_TicksSinceLastBurnDamage >= BURN_TICKS_PER_DAMAGE)
{
- TakeDamage(dtOnFire, NULL, BURN_DAMAGE, 0);
+ if (!m_IsFireproof)
+ {
+ TakeDamage(dtOnFire, NULL, BURN_DAMAGE, 0);
+ }
m_TicksSinceLastBurnDamage = 0;
}
m_TicksLeftBurning--;
@@ -856,7 +859,10 @@ void cEntity::TickBurning(cChunk & a_Chunk)
m_TicksSinceLastLavaDamage++;
if (m_TicksSinceLastLavaDamage >= LAVA_TICKS_PER_DAMAGE)
{
- TakeDamage(dtLavaContact, NULL, LAVA_DAMAGE, 0);
+ if (!m_IsFireproof)
+ {
+ TakeDamage(dtLavaContact, NULL, LAVA_DAMAGE, 0);
+ }
m_TicksSinceLastLavaDamage = 0;
}
}
@@ -874,7 +880,10 @@ void cEntity::TickBurning(cChunk & a_Chunk)
m_TicksSinceLastFireDamage++;
if (m_TicksSinceLastFireDamage >= FIRE_TICKS_PER_DAMAGE)
{
- TakeDamage(dtFireContact, NULL, FIRE_DAMAGE, 0);
+ if (!m_IsFireproof)
+ {
+ TakeDamage(dtFireContact, NULL, FIRE_DAMAGE, 0);
+ }
m_TicksSinceLastFireDamage = 0;
}
}
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h
index 8f3899e2f..84a2003d4 100644
--- a/src/Entities/Entity.h
+++ b/src/Entities/Entity.h
@@ -435,6 +435,9 @@ protected:
cWorld * m_World;
+ /// Whether the entity is capable of taking fire or lava damage.
+ bool m_IsFireproof;
+
/// Time, in ticks, since the last damage dealt by being on fire. Valid only if on fire (IsOnFire())
int m_TicksSinceLastBurnDamage;