diff options
author | p-mcgowan <mickeymcgowan@shaw.ca> | 2014-11-23 00:33:34 +0100 |
---|---|---|
committer | p-mcgowan <mickeymcgowan@shaw.ca> | 2014-11-23 00:33:34 +0100 |
commit | d1b7a965d10c66a27e1c4593ce3637a2537309d9 (patch) | |
tree | 388cb4e7fbd89e8223af686d6139d2df21b9c623 /src/Mobs/Pig.cpp | |
parent | Merge pull request #1610 from p-mcgowan/villagersIntoWitchOnLightning (diff) | |
download | cuberite-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.cpp | 16 |
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 |