Fixed cactus detection and zombie pigman sword (#3584)
Fixes for issues #902 and #2917
This commit is contained in:
parent
7c17f77c84
commit
6fe863c2ad
@ -1359,7 +1359,8 @@ void cEntity::DetectCacti(void)
|
|||||||
((GetPosX() - X < w) && (GetWorld()->GetBlock(X - 1, Y, Z) == E_BLOCK_CACTUS)) ||
|
((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)) ||
|
(((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)) ||
|
((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);
|
TakeDamage(dtCactusContact, nullptr, 1, 0);
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "ZombiePigman.h"
|
#include "ZombiePigman.h"
|
||||||
#include "../World.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)
|
void cZombiePigman::KilledBy(TakeDamageInfo & a_TDI)
|
||||||
{
|
{
|
||||||
super::KilledBy(a_TDI);
|
super::KilledBy(a_TDI);
|
||||||
|
@ -18,6 +18,7 @@ public:
|
|||||||
|
|
||||||
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
|
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
|
||||||
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
|
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
|
||||||
|
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
|
||||||
|
|
||||||
virtual bool IsUndead(void) override { return true; }
|
virtual bool IsUndead(void) override { return true; }
|
||||||
} ;
|
} ;
|
||||||
|
Loading…
Reference in New Issue
Block a user