1
0

Monster fixes

* Fixes #1203
* Fixes #627
This commit is contained in:
Tiger Wang 2014-07-18 10:47:00 +01:00
parent 38aeaa64ed
commit f1be1eb674
8 changed files with 6 additions and 36 deletions

@ -1 +1 @@
Subproject commit 784b04ff9afd5faeaeb15c3fa159ff98adf55182 Subproject commit 1ed82759c68f92c4acc7e3f33b850cf9f01c8aba

View File

@ -496,9 +496,6 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info)
a_Info[E_BLOCK_CROPS ].m_IsSolid = false; a_Info[E_BLOCK_CROPS ].m_IsSolid = false;
a_Info[E_BLOCK_DANDELION ].m_IsSolid = false; a_Info[E_BLOCK_DANDELION ].m_IsSolid = false;
a_Info[E_BLOCK_DETECTOR_RAIL ].m_IsSolid = false; a_Info[E_BLOCK_DETECTOR_RAIL ].m_IsSolid = false;
a_Info[E_BLOCK_END_PORTAL ].m_IsSolid = false;
a_Info[E_BLOCK_FENCE ].m_IsSolid = false;
a_Info[E_BLOCK_FENCE_GATE ].m_IsSolid = false;
a_Info[E_BLOCK_FIRE ].m_IsSolid = false; a_Info[E_BLOCK_FIRE ].m_IsSolid = false;
a_Info[E_BLOCK_FLOWER ].m_IsSolid = false; a_Info[E_BLOCK_FLOWER ].m_IsSolid = false;
a_Info[E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE].m_IsSolid = false; a_Info[E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE].m_IsSolid = false;
@ -530,7 +527,6 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info)
a_Info[E_BLOCK_WATER ].m_IsSolid = false; a_Info[E_BLOCK_WATER ].m_IsSolid = false;
a_Info[E_BLOCK_WOODEN_BUTTON ].m_IsSolid = false; a_Info[E_BLOCK_WOODEN_BUTTON ].m_IsSolid = false;
a_Info[E_BLOCK_WOODEN_PRESSURE_PLATE].m_IsSolid = false; a_Info[E_BLOCK_WOODEN_PRESSURE_PLATE].m_IsSolid = false;
a_Info[E_BLOCK_WOODEN_SLAB ].m_IsSolid = false;
// Blocks that fully occupy their voxel - used as a guide for torch placeable blocks, amongst other things: // Blocks that fully occupy their voxel - used as a guide for torch placeable blocks, amongst other things:

View File

@ -115,8 +115,6 @@ void cMonster::TickPathFinding()
const int PosY = POSY_TOINT; const int PosY = POSY_TOINT;
const int PosZ = POSZ_TOINT; const int PosZ = POSZ_TOINT;
m_FinalDestination.y = (double)FindFirstNonAirBlockPosition(m_FinalDestination.x, m_FinalDestination.z);
std::vector<Vector3d> m_PotentialCoordinates; std::vector<Vector3d> m_PotentialCoordinates;
m_TraversedCoordinates.push_back(Vector3i(PosX, PosY, PosZ)); m_TraversedCoordinates.push_back(Vector3i(PosX, PosY, PosZ));
@ -201,19 +199,6 @@ void cMonster::TickPathFinding()
void cMonster::MoveToPosition(const Vector3f & a_Position)
{
FinishPathFinding();
m_FinalDestination = a_Position;
m_bMovingToDestination = true;
TickPathFinding();
}
void cMonster::MoveToPosition(const Vector3d & a_Position) void cMonster::MoveToPosition(const Vector3d & a_Position)
{ {
FinishPathFinding(); FinishPathFinding();
@ -227,15 +212,7 @@ void cMonster::MoveToPosition(const Vector3d & a_Position)
bool cMonster::IsCoordinateInTraversedList(Vector3i a_Coords) bool cMonster::IsCoordinateInTraversedList(Vector3i a_Coords)
{ {
for (std::vector<Vector3i>::const_iterator itr = m_TraversedCoordinates.begin(); itr != m_TraversedCoordinates.end(); ++itr) return (std::find(m_TraversedCoordinates.begin(), m_TraversedCoordinates.end(), a_Coords) != m_TraversedCoordinates.end());
{
if (itr->Equals(a_Coords))
{
return true;
}
}
return false;
} }
@ -296,8 +273,6 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk)
{ {
if (m_bOnGround) if (m_bOnGround)
{ {
m_Destination.y = FindFirstNonAirBlockPosition(m_Destination.x, m_Destination.z);
if (DoesPosYRequireJump((int)floor(m_Destination.y))) if (DoesPosYRequireJump((int)floor(m_Destination.y)))
{ {
m_bOnGround = false; m_bOnGround = false;

View File

@ -92,7 +92,6 @@ public:
virtual void KilledBy(TakeDamageInfo & a_TDI) override; virtual void KilledBy(TakeDamageInfo & a_TDI) override;
virtual void MoveToPosition(const Vector3f & a_Position);
virtual void MoveToPosition(const Vector3d & a_Position); // tolua_export virtual void MoveToPosition(const Vector3d & a_Position); // tolua_export
virtual bool ReachedDestination(void); virtual bool ReachedDestination(void);

View File

@ -48,7 +48,7 @@ void cSkeleton::GetDrops(cItems & a_Drops, cEntity * a_Killer)
void cSkeleton::MoveToPosition(const Vector3f & a_Position) void cSkeleton::MoveToPosition(const Vector3d & a_Position)
{ {
// If the destination is sufficiently skylight challenged AND the skeleton isn't on fire then block the movement // If the destination is sufficiently skylight challenged AND the skeleton isn't on fire then block the movement
if ( if (

View File

@ -18,7 +18,7 @@ public:
CLASS_PROTODEF(cSkeleton); CLASS_PROTODEF(cSkeleton);
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
virtual void MoveToPosition(const Vector3f & a_Position) override; virtual void MoveToPosition(const Vector3d & a_Position) override;
virtual void Attack(float a_Dt) override; virtual void Attack(float a_Dt) override;
virtual void SpawnOn(cClientHandle & a_ClientHandle) override; virtual void SpawnOn(cClientHandle & a_ClientHandle) override;

View File

@ -42,7 +42,7 @@ void cZombie::GetDrops(cItems & a_Drops, cEntity * a_Killer)
void cZombie::MoveToPosition(const Vector3f & a_Position) void cZombie::MoveToPosition(const Vector3d & a_Position)
{ {
// If the destination is sufficiently skylight challenged AND the skeleton isn't on fire then block the movement // If the destination is sufficiently skylight challenged AND the skeleton isn't on fire then block the movement
if ( if (

View File

@ -17,7 +17,7 @@ public:
CLASS_PROTODEF(cZombie); CLASS_PROTODEF(cZombie);
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
virtual void MoveToPosition(const Vector3f & a_Position) override; virtual void MoveToPosition(const Vector3d & a_Position) override;
bool IsVillagerZombie(void) const {return m_IsVillagerZombie; } bool IsVillagerZombie(void) const {return m_IsVillagerZombie; }
bool IsConverting (void) const {return m_IsConverting; } bool IsConverting (void) const {return m_IsConverting; }