Lay foundation for fireproof entities.
Prevent any entities with the m_Fireproof flag from taking fire or lava damage.
This commit is contained in:
parent
e3ec857264
commit
bca7f29490
@ -788,7 +788,10 @@ void cEntity::TickBurning(cChunk & a_Chunk)
|
|||||||
m_TicksSinceLastBurnDamage++;
|
m_TicksSinceLastBurnDamage++;
|
||||||
if (m_TicksSinceLastBurnDamage >= BURN_TICKS_PER_DAMAGE)
|
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_TicksSinceLastBurnDamage = 0;
|
||||||
}
|
}
|
||||||
m_TicksLeftBurning--;
|
m_TicksLeftBurning--;
|
||||||
@ -856,7 +859,10 @@ void cEntity::TickBurning(cChunk & a_Chunk)
|
|||||||
m_TicksSinceLastLavaDamage++;
|
m_TicksSinceLastLavaDamage++;
|
||||||
if (m_TicksSinceLastLavaDamage >= LAVA_TICKS_PER_DAMAGE)
|
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;
|
m_TicksSinceLastLavaDamage = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -874,7 +880,10 @@ void cEntity::TickBurning(cChunk & a_Chunk)
|
|||||||
m_TicksSinceLastFireDamage++;
|
m_TicksSinceLastFireDamage++;
|
||||||
if (m_TicksSinceLastFireDamage >= FIRE_TICKS_PER_DAMAGE)
|
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;
|
m_TicksSinceLastFireDamage = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -435,6 +435,9 @@ protected:
|
|||||||
|
|
||||||
cWorld * m_World;
|
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())
|
/// Time, in ticks, since the last damage dealt by being on fire. Valid only if on fire (IsOnFire())
|
||||||
int m_TicksSinceLastBurnDamage;
|
int m_TicksSinceLastBurnDamage;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user