summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorp-mcgowan <mickeymcgowan@shaw.ca>2014-11-22 08:36:35 +0100
committerp-mcgowan <mickeymcgowan@shaw.ca>2014-11-22 08:36:35 +0100
commit635e9321c6524d0ba4bba9ce2d716869373fdfac (patch)
tree8ec12980f5933c22a4406c7ff3c57756b0db0a2b
parentvillagers turn into witches when struck by lightning (diff)
downloadcuberite-635e9321c6524d0ba4bba9ce2d716869373fdfac.tar
cuberite-635e9321c6524d0ba4bba9ce2d716869373fdfac.tar.gz
cuberite-635e9321c6524d0ba4bba9ce2d716869373fdfac.tar.bz2
cuberite-635e9321c6524d0ba4bba9ce2d716869373fdfac.tar.lz
cuberite-635e9321c6524d0ba4bba9ce2d716869373fdfac.tar.xz
cuberite-635e9321c6524d0ba4bba9ce2d716869373fdfac.tar.zst
cuberite-635e9321c6524d0ba4bba9ce2d716869373fdfac.zip
-rw-r--r--src/Mobs/Villager.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Mobs/Villager.cpp b/src/Mobs/Villager.cpp
index 371132dfb..6bf88bd80 100644
--- a/src/Mobs/Villager.cpp
+++ b/src/Mobs/Villager.cpp
@@ -37,10 +37,12 @@ bool cVillager::DoTakeDamage(TakeDamageInfo & a_TDI)
m_World->BroadcastEntityStatus(*this, esVillagerAngry);
}
}
+
if (a_TDI.DamageType == dtLightning)
{
- m_World->SpawnMob((int) GetPosX(), (int) GetPosY(), (int) GetPosZ(), mtWitch);
- super::Destroy(this);
+ Destroy();
+ m_World->SpawnMob(GetPosX(), GetPosY(), GetPosZ(), mtWitch);
+ return true;
}
return true;
}