summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Pig.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mobs/Pig.cpp')
-rw-r--r--src/Mobs/Pig.cpp16
1 files changed, 16 insertions, 0 deletions
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