summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Villager.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-10-03 23:22:59 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-10-03 23:22:59 +0200
commit8aaf1c45e812ca84e5492c84c3cde271f97ae09b (patch)
treeda6050ffd1dc9e0951619e301a876a08b7f87eac /src/Mobs/Villager.cpp
parentQtBiomeVisualiser: Added mouse hover info. (diff)
downloadcuberite-8aaf1c45e812ca84e5492c84c3cde271f97ae09b.tar
cuberite-8aaf1c45e812ca84e5492c84c3cde271f97ae09b.tar.gz
cuberite-8aaf1c45e812ca84e5492c84c3cde271f97ae09b.tar.bz2
cuberite-8aaf1c45e812ca84e5492c84c3cde271f97ae09b.tar.lz
cuberite-8aaf1c45e812ca84e5492c84c3cde271f97ae09b.tar.xz
cuberite-8aaf1c45e812ca84e5492c84c3cde271f97ae09b.tar.zst
cuberite-8aaf1c45e812ca84e5492c84c3cde271f97ae09b.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Villager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Mobs/Villager.cpp b/src/Mobs/Villager.cpp
index 0efd5501e..781816c75 100644
--- a/src/Mobs/Villager.cpp
+++ b/src/Mobs/Villager.cpp
@@ -30,6 +30,13 @@ bool cVillager::DoTakeDamage(TakeDamageInfo & a_TDI)
return false;
}
+ if (a_TDI.DamageType == dtLightning)
+ {
+ Destroy();
+ GetWorld()->SpawnMob(GetPosX(), GetPosY(), GetPosZ(), mtWitch);
+ return true;
+ }
+
if ((a_TDI.Attacker != NULL) && a_TDI.Attacker->IsPlayer())
{
if (m_World->GetTickRandomNumber(5) == 3)