diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-05-01 20:50:40 +0200 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-05-01 20:50:40 +0200 |
commit | 8780b324ff075f17358b01bc3615da0397fbe8be (patch) | |
tree | d448ab665fd50cca3861e06654f8668a89c8d953 /src/Mobs/Villager.cpp | |
parent | Added Testing capability (diff) | |
parent | Fixed MSVC2013 compilation. (diff) | |
download | cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar.gz cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar.bz2 cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar.lz cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar.xz cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar.zst cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.zip |
Diffstat (limited to 'src/Mobs/Villager.cpp')
-rw-r--r-- | src/Mobs/Villager.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Mobs/Villager.cpp b/src/Mobs/Villager.cpp index d049acc1e..41283acf4 100644 --- a/src/Mobs/Villager.cpp +++ b/src/Mobs/Villager.cpp @@ -23,9 +23,13 @@ cVillager::cVillager(eVillagerType VillagerType) : -void cVillager::DoTakeDamage(TakeDamageInfo & a_TDI) +bool cVillager::DoTakeDamage(TakeDamageInfo & a_TDI) { - super::DoTakeDamage(a_TDI); + if (!super::DoTakeDamage(a_TDI)) + { + return false; + } + if ((a_TDI.Attacker != NULL) && a_TDI.Attacker->IsPlayer()) { if (m_World->GetTickRandomNumber(5) == 3) @@ -33,6 +37,7 @@ void cVillager::DoTakeDamage(TakeDamageInfo & a_TDI) m_World->BroadcastEntityStatus(*this, esVillagerAngry); } } + return true; } |