diff options
author | tonibm19 <tonibm19@gmail.com> | 2014-02-03 20:52:11 +0100 |
---|---|---|
committer | tonibm19 <tonibm19@gmail.com> | 2014-02-03 20:52:11 +0100 |
commit | c2e7dd34d98258bdfa5baa2f27f08999909996c5 (patch) | |
tree | a402d6ecad32c4effafed2c7d27ea87f357685e5 /src | |
parent | Merge pull request #623 from mc-server/tnt (diff) | |
download | cuberite-c2e7dd34d98258bdfa5baa2f27f08999909996c5.tar cuberite-c2e7dd34d98258bdfa5baa2f27f08999909996c5.tar.gz cuberite-c2e7dd34d98258bdfa5baa2f27f08999909996c5.tar.bz2 cuberite-c2e7dd34d98258bdfa5baa2f27f08999909996c5.tar.lz cuberite-c2e7dd34d98258bdfa5baa2f27f08999909996c5.tar.xz cuberite-c2e7dd34d98258bdfa5baa2f27f08999909996c5.tar.zst cuberite-c2e7dd34d98258bdfa5baa2f27f08999909996c5.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/Entities/Entity.h | 1 | ||||
-rw-r--r-- | src/Item.h | 2 | ||||
-rw-r--r-- | src/Mobs/Monster.cpp | 8 | ||||
-rw-r--r-- | src/Mobs/Monster.h | 1 | ||||
-rw-r--r-- | src/World.cpp | 2 | ||||
-rw-r--r-- | src/World.h | 2 |
6 files changed, 13 insertions, 3 deletions
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h index b2edfc2b4..5287e3a6d 100644 --- a/src/Entities/Entity.h +++ b/src/Entities/Entity.h @@ -158,6 +158,7 @@ public: double GetHeight (void) const { return m_Height; } double GetMass (void) const { return m_Mass; } const Vector3d & GetPosition (void) const { return m_Pos; } + const Vector3d & GetPosition (void) const { return m_Pos; } double GetPosX (void) const { return m_Pos.x; } double GetPosY (void) const { return m_Pos.y; } double GetPosZ (void) const { return m_Pos.z; } 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..35880bcff 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -188,6 +188,14 @@ void cMonster::MoveToPosition(const Vector3f & a_Position) TickPathFinding(); } +void cMonster::MoveToPosition(const Vector3d & a_Position) +{ + FinishPathFinding(); + + m_FinalDestination = a_Position; + m_bMovingToDestination = true; + TickPathFinding(); +} 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 de2002b84..410326b2d 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 bf6a4ba28..531154181 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); // tolua_export void SendPlayerList(cPlayer * a_DestPlayer); // Sends playerlist to the player |