pigs turn into pigmen on lightning
This commit is contained in:
parent
075daf9beb
commit
d1b7a965d1
@ -98,3 +98,19 @@ 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)
|
||||
|
||||
// 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;
|
||||
|
Loading…
Reference in New Issue
Block a user