From d1b7a965d10c66a27e1c4593ce3637a2537309d9 Mon Sep 17 00:00:00 2001 From: p-mcgowan Date: Sat, 22 Nov 2014 15:33:34 -0800 Subject: pigs turn into pigmen on lightning --- src/Mobs/Pig.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/Mobs/Pig.cpp') diff --git a/src/Mobs/Pig.cpp b/src/Mobs/Pig.cpp index 55a4412ca..ce53d04fb 100644 --- a/src/Mobs/Pig.cpp +++ b/src/Mobs/Pig.cpp @@ -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; +} \ No newline at end of file -- cgit v1.2.3