summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-04-22 13:59:34 +0200
committerarchshift <admin@archshift.com>2014-04-22 13:59:34 +0200
commitbca7f2949032ab90ee03988f560bce157a25b683 (patch)
treef77522ac059ade62d9b0b66ff6c3b7e2b64572e4 /src/Entities
parentAdded prefab hitboxes. (diff)
downloadcuberite-bca7f2949032ab90ee03988f560bce157a25b683.tar
cuberite-bca7f2949032ab90ee03988f560bce157a25b683.tar.gz
cuberite-bca7f2949032ab90ee03988f560bce157a25b683.tar.bz2
cuberite-bca7f2949032ab90ee03988f560bce157a25b683.tar.lz
cuberite-bca7f2949032ab90ee03988f560bce157a25b683.tar.xz
cuberite-bca7f2949032ab90ee03988f560bce157a25b683.tar.zst
cuberite-bca7f2949032ab90ee03988f560bce157a25b683.zip
Diffstat (limited to 'src/Entities')
-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..345e0054b 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_Fireproof)
+ {
+ 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_Fireproof)
+ {
+ 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_Fireproof)
+ {
+ TakeDamage(dtFireContact, NULL, FIRE_DAMAGE, 0);
+ }
m_TicksSinceLastFireDamage = 0;
}
}
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h
index 8f3899e2f..ea85ac683 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_Fireproof;
+
/// Time, in ticks, since the last damage dealt by being on fire. Valid only if on fire (IsOnFire())
int m_TicksSinceLastBurnDamage;