1
0

Merge pull request #1612 from p-mcgowan/pigsIntoZombiePigmenOnLightning

pigs turn into pigmen on lightning
This commit is contained in:
Mattes D 2014-11-23 09:27:46 +01:00
commit dea8b684b2
2 changed files with 23 additions and 0 deletions

View File

@ -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;
}

View File

@ -17,6 +17,9 @@ public:
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 OnRightClicked(cPlayer & a_Player) override;
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;