diff options
author | Mattes D <github@xoft.cz> | 2014-11-23 09:27:46 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-11-23 09:27:46 +0100 |
commit | dea8b684b2fad095c8d9d57111a3dce420b585af (patch) | |
tree | 2f414117376cbe8e6f72584885803290f9f46016 /src/Mobs/Pig.cpp | |
parent | Merge pull request #1610 from p-mcgowan/villagersIntoWitchOnLightning (diff) | |
parent | formatting - newline at EOF inserted: Pig.cpp (diff) | |
download | cuberite-dea8b684b2fad095c8d9d57111a3dce420b585af.tar cuberite-dea8b684b2fad095c8d9d57111a3dce420b585af.tar.gz cuberite-dea8b684b2fad095c8d9d57111a3dce420b585af.tar.bz2 cuberite-dea8b684b2fad095c8d9d57111a3dce420b585af.tar.lz cuberite-dea8b684b2fad095c8d9d57111a3dce420b585af.tar.xz cuberite-dea8b684b2fad095c8d9d57111a3dce420b585af.tar.zst cuberite-dea8b684b2fad095c8d9d57111a3dce420b585af.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Mobs/Pig.cpp | 20 |
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; +} + + + + |