diff options
author | Mattes D <github@xoft.cz> | 2014-02-04 18:23:03 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-02-04 18:23:03 +0100 |
commit | 0ceb0ef607ac94315ea23c35dd7a57c4c5c27508 (patch) | |
tree | 23ab496c5f20c54c0ccaef76aa682c44e85e4fe6 /src | |
parent | Fixed calling plugins with userdata params. (diff) | |
parent | Fixed indentation (diff) | |
download | cuberite-0ceb0ef607ac94315ea23c35dd7a57c4c5c27508.tar cuberite-0ceb0ef607ac94315ea23c35dd7a57c4c5c27508.tar.gz cuberite-0ceb0ef607ac94315ea23c35dd7a57c4c5c27508.tar.bz2 cuberite-0ceb0ef607ac94315ea23c35dd7a57c4c5c27508.tar.lz cuberite-0ceb0ef607ac94315ea23c35dd7a57c4c5c27508.tar.xz cuberite-0ceb0ef607ac94315ea23c35dd7a57c4c5c27508.tar.zst cuberite-0ceb0ef607ac94315ea23c35dd7a57c4c5c27508.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/Item.h | 2 | ||||
-rw-r--r-- | src/Mobs/Monster.cpp | 12 | ||||
-rw-r--r-- | src/Mobs/Monster.h | 1 | ||||
-rw-r--r-- | src/World.cpp | 2 | ||||
-rw-r--r-- | src/World.h | 2 |
5 files changed, 16 insertions, 3 deletions
diff --git a/src/Item.h b/src/Item.h index 727965112..7781db0cb 100644 --- a/src/Item.h +++ b/src/Item.h @@ -167,7 +167,7 @@ public: void FromJson(const Json::Value & a_Value); /// Returns true if the specified item type is enchantable (as per 1.2.5 protocol requirements) - static bool IsEnchantable(short a_ItemType); + static bool IsEnchantable(short a_ItemType); // tolua_export // tolua_begin diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 283ef36e6..340761a7e 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -191,6 +191,18 @@ void cMonster::MoveToPosition(const Vector3f & a_Position) + +void cMonster::MoveToPosition(const Vector3d & a_Position) +{ + FinishPathFinding(); + + m_FinalDestination = a_Position; + m_bMovingToDestination = true; + TickPathFinding(); +} + + + bool cMonster::IsCoordinateInTraversedList(Vector3i a_Coords) { for (std::vector<Vector3i>::const_iterator itr = m_TraversedCoordinates.begin(); itr != m_TraversedCoordinates.end(); ++itr) diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h index 1dd302cdc..714feddb9 100644 --- a/src/Mobs/Monster.h +++ b/src/Mobs/Monster.h @@ -91,6 +91,7 @@ public: virtual void KilledBy(cEntity * a_Killer) override; virtual void MoveToPosition(const Vector3f & a_Position); + virtual void MoveToPosition(const Vector3d & a_Position); // tolua_export virtual bool ReachedDestination(void); // tolua_begin diff --git a/src/World.cpp b/src/World.cpp index f9a6e7776..d6c9b293d 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -2339,7 +2339,7 @@ bool cWorld::FindAndDoWithPlayer(const AString & a_PlayerNameHint, cPlayerListCa // TODO: This interface is dangerous! -cPlayer * cWorld::FindClosestPlayer(const Vector3f & a_Pos, float a_SightLimit, bool a_CheckLineOfSight) +cPlayer * cWorld::FindClosestPlayer(const Vector3d & a_Pos, float a_SightLimit, bool a_CheckLineOfSight) { cTracer LineOfSight(this); diff --git a/src/World.h b/src/World.h index afdc09788..8cf860ff5 100644 --- a/src/World.h +++ b/src/World.h @@ -248,7 +248,7 @@ public: bool FindAndDoWithPlayer(const AString & a_PlayerNameHint, cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS << // TODO: This interface is dangerous - rewrite to DoWithClosestPlayer(pos, sight, action) - cPlayer * FindClosestPlayer(const Vector3f & a_Pos, float a_SightLimit, bool a_CheckLineOfSight = true); + cPlayer * FindClosestPlayer(const Vector3d & a_Pos, float a_SightLimit, bool a_CheckLineOfSight = true); void SendPlayerList(cPlayer * a_DestPlayer); // Sends playerlist to the player |