Merge pull request #2875 from LogicParrot/fallDamage
Fix fall damage crash when tamed wolves neabry
This commit is contained in:
commit
5ca2f4fd0c
@ -854,7 +854,10 @@ bool cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI)
|
|||||||
AddFoodExhaustion(0.3f);
|
AddFoodExhaustion(0.3f);
|
||||||
SendHealth();
|
SendHealth();
|
||||||
|
|
||||||
NotifyFriendlyWolves(a_TDI.Attacker);
|
if (a_TDI.Attacker != nullptr)
|
||||||
|
{
|
||||||
|
NotifyFriendlyWolves(a_TDI.Attacker);
|
||||||
|
}
|
||||||
m_Stats.AddValue(statDamageTaken, FloorC<StatValue>(a_TDI.FinalDamage * 10 + 0.5));
|
m_Stats.AddValue(statDamageTaken, FloorC<StatValue>(a_TDI.FinalDamage * 10 + 0.5));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -867,6 +870,7 @@ bool cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI)
|
|||||||
|
|
||||||
void cPlayer::NotifyFriendlyWolves(cEntity * a_Opponent)
|
void cPlayer::NotifyFriendlyWolves(cEntity * a_Opponent)
|
||||||
{
|
{
|
||||||
|
ASSERT(a_Opponent != nullptr);
|
||||||
class LookForWolves : public cEntityCallback
|
class LookForWolves : public cEntityCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user