summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Pig.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-11-29 12:05:35 +0100
committerHowaner <franzi.moos@googlemail.com>2014-11-29 12:05:35 +0100
commit648fee1a087cb97da9a4646d72ffc590e7837a67 (patch)
treeeb55b68428a303089bc1120e9c3593542059f18e /src/Mobs/Pig.cpp
parentFinished mob spawner implementation. (diff)
parentMerge pull request #1619 from mc-server/WarningFixes (diff)
downloadcuberite-648fee1a087cb97da9a4646d72ffc590e7837a67.tar
cuberite-648fee1a087cb97da9a4646d72ffc590e7837a67.tar.gz
cuberite-648fee1a087cb97da9a4646d72ffc590e7837a67.tar.bz2
cuberite-648fee1a087cb97da9a4646d72ffc590e7837a67.tar.lz
cuberite-648fee1a087cb97da9a4646d72ffc590e7837a67.tar.xz
cuberite-648fee1a087cb97da9a4646d72ffc590e7837a67.tar.zst
cuberite-648fee1a087cb97da9a4646d72ffc590e7837a67.zip
Diffstat (limited to 'src/Mobs/Pig.cpp')
-rw-r--r--src/Mobs/Pig.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Mobs/Pig.cpp b/src/Mobs/Pig.cpp
index 55a4412ca..50b69e44f 100644
--- a/src/Mobs/Pig.cpp
+++ b/src/Mobs/Pig.cpp
@@ -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;
+}
+
+
+
+