Entity: only fire critical hit if damage type is physical
This commit is contained in:
parent
8eceaf9b0c
commit
5803094d7d
@ -310,7 +310,8 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
|
|||||||
cPlayer * Player = (cPlayer *)a_TDI.Attacker;
|
cPlayer * Player = (cPlayer *)a_TDI.Attacker;
|
||||||
|
|
||||||
// IsOnGround() only is false if the player is moving downwards
|
// IsOnGround() only is false if the player is moving downwards
|
||||||
if (!Player->IsOnGround()) // TODO: Better damage increase, and check for enchantments (and use magic critical instead of plain)
|
// TODO: Better damage increase, and check for enchantments (and use magic critical instead of plain)
|
||||||
|
if (!Player->IsOnGround() && (a_TDI.DamageType == dtAttack || a_TDI.DamageType == dtArrowAttack))
|
||||||
{
|
{
|
||||||
a_TDI.FinalDamage += 2;
|
a_TDI.FinalDamage += 2;
|
||||||
m_World->BroadcastEntityAnimation(*this, 4); // Critical hit
|
m_World->BroadcastEntityAnimation(*this, 4); // Critical hit
|
||||||
|
Loading…
Reference in New Issue
Block a user