summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Entities/Entity.cpp3
-rw-r--r--src/Mobs/ZombiePigman.cpp11
-rw-r--r--src/Mobs/ZombiePigman.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index d155d9d9d..a37100c8b 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -1359,7 +1359,8 @@ void cEntity::DetectCacti(void)
((GetPosX() - X < w) && (GetWorld()->GetBlock(X - 1, Y, Z) == E_BLOCK_CACTUS)) ||
(((Z + 1) - GetPosZ() < w) && (GetWorld()->GetBlock(X, Y, Z + 1) == E_BLOCK_CACTUS)) ||
((GetPosZ() - Z < w) && (GetWorld()->GetBlock(X, Y, Z - 1) == E_BLOCK_CACTUS)) ||
- (((GetPosY() - Y < 1) && (GetWorld()->GetBlock(X, Y, Z) == E_BLOCK_CACTUS))))
+ (((Y + 1) - GetPosY() < w) && (GetWorld()->GetBlock(X, Y + 1, Z) == E_BLOCK_CACTUS)) ||
+ ((GetPosY() - Y < 1) && (GetWorld()->GetBlock(X, Y - 1, Z) == E_BLOCK_CACTUS)))
)
{
TakeDamage(dtCactusContact, nullptr, 1, 0);
diff --git a/src/Mobs/ZombiePigman.cpp b/src/Mobs/ZombiePigman.cpp
index 39e7ba9c7..2581d3751 100644
--- a/src/Mobs/ZombiePigman.cpp
+++ b/src/Mobs/ZombiePigman.cpp
@@ -2,6 +2,7 @@
#include "ZombiePigman.h"
#include "../World.h"
+#include "ClientHandle.h"
@@ -37,6 +38,16 @@ void cZombiePigman::GetDrops(cItems & a_Drops, cEntity * a_Killer)
+void cZombiePigman::SpawnOn(cClientHandle & a_ClientHandle)
+{
+ super::SpawnOn(a_ClientHandle);
+ a_ClientHandle.SendEntityEquipment(*this, 0, cItem(E_ITEM_GOLD_SWORD));
+}
+
+
+
+
+
void cZombiePigman::KilledBy(TakeDamageInfo & a_TDI)
{
super::KilledBy(a_TDI);
diff --git a/src/Mobs/ZombiePigman.h b/src/Mobs/ZombiePigman.h
index c8f6753a4..23a7be8da 100644
--- a/src/Mobs/ZombiePigman.h
+++ b/src/Mobs/ZombiePigman.h
@@ -18,6 +18,7 @@ public:
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
+ virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
virtual bool IsUndead(void) override { return true; }
} ;