summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-18 11:47:00 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-18 11:47:00 +0200
commitf1be1eb6743700515de3a522898ba99680cf24c0 (patch)
tree8659ffc129ddd0343d483f882462a3d81c23f86e /src/Mobs/Monster.cpp
parentMCServer supports Minecraft v1.7.10 (diff)
downloadcuberite-f1be1eb6743700515de3a522898ba99680cf24c0.tar
cuberite-f1be1eb6743700515de3a522898ba99680cf24c0.tar.gz
cuberite-f1be1eb6743700515de3a522898ba99680cf24c0.tar.bz2
cuberite-f1be1eb6743700515de3a522898ba99680cf24c0.tar.lz
cuberite-f1be1eb6743700515de3a522898ba99680cf24c0.tar.xz
cuberite-f1be1eb6743700515de3a522898ba99680cf24c0.tar.zst
cuberite-f1be1eb6743700515de3a522898ba99680cf24c0.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Monster.cpp27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index ba901df4e..1369746df 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -115,8 +115,6 @@ void cMonster::TickPathFinding()
const int PosY = POSY_TOINT;
const int PosZ = POSZ_TOINT;
- m_FinalDestination.y = (double)FindFirstNonAirBlockPosition(m_FinalDestination.x, m_FinalDestination.z);
-
std::vector<Vector3d> m_PotentialCoordinates;
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)
{
FinishPathFinding();
@@ -227,15 +212,7 @@ void cMonster::MoveToPosition(const Vector3d & a_Position)
bool cMonster::IsCoordinateInTraversedList(Vector3i a_Coords)
{
- for (std::vector<Vector3i>::const_iterator itr = m_TraversedCoordinates.begin(); itr != m_TraversedCoordinates.end(); ++itr)
- {
- if (itr->Equals(a_Coords))
- {
- return true;
- }
- }
-
- return false;
+ return (std::find(m_TraversedCoordinates.begin(), m_TraversedCoordinates.end(), a_Coords) != m_TraversedCoordinates.end());
}
@@ -296,8 +273,6 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk)
{
if (m_bOnGround)
{
- m_Destination.y = FindFirstNonAirBlockPosition(m_Destination.x, m_Destination.z);
-
if (DoesPosYRequireJump((int)floor(m_Destination.y)))
{
m_bOnGround = false;