Merge pull request #1612 from p-mcgowan/pigsIntoZombiePigmenOnLightning
pigs turn into pigmen on lightning
This commit is contained in:
commit
dea8b684b2
@ -98,3 +98,23 @@ void cPig::Tick(float a_Dt, cChunk & a_Chunk)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool cPig::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||||
|
{
|
||||||
|
if (!super::DoTakeDamage(a_TDI))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (a_TDI.DamageType == dtLightning)
|
||||||
|
{
|
||||||
|
Destroy();
|
||||||
|
m_World->SpawnMob(GetPosX(), GetPosY(), GetPosZ(), mtZombiePigman);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,6 +17,9 @@ public:
|
|||||||
|
|
||||||
CLASS_PROTODEF(cPig)
|
CLASS_PROTODEF(cPig)
|
||||||
|
|
||||||
|
// cEntity overrides
|
||||||
|
virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
|
||||||
|
|
||||||
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
|
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
|
||||||
virtual void OnRightClicked(cPlayer & a_Player) override;
|
virtual void OnRightClicked(cPlayer & a_Player) override;
|
||||||
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
|
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
|
||||||
|
Loading…
Reference in New Issue
Block a user