summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Pig.cpp
diff options
context:
space:
mode:
authorp-mcgowan <mickeymcgowan@shaw.ca>2014-11-23 00:33:34 +0100
committerp-mcgowan <mickeymcgowan@shaw.ca>2014-11-23 00:33:34 +0100
commitd1b7a965d10c66a27e1c4593ce3637a2537309d9 (patch)
tree388cb4e7fbd89e8223af686d6139d2df21b9c623 /src/Mobs/Pig.cpp
parentMerge pull request #1610 from p-mcgowan/villagersIntoWitchOnLightning (diff)
downloadcuberite-d1b7a965d10c66a27e1c4593ce3637a2537309d9.tar
cuberite-d1b7a965d10c66a27e1c4593ce3637a2537309d9.tar.gz
cuberite-d1b7a965d10c66a27e1c4593ce3637a2537309d9.tar.bz2
cuberite-d1b7a965d10c66a27e1c4593ce3637a2537309d9.tar.lz
cuberite-d1b7a965d10c66a27e1c4593ce3637a2537309d9.tar.xz
cuberite-d1b7a965d10c66a27e1c4593ce3637a2537309d9.tar.zst
cuberite-d1b7a965d10c66a27e1c4593ce3637a2537309d9.zip
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