summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2016-03-30 12:38:24 +0200
committerAlexander Harkness <me@bearbin.net>2016-03-30 12:38:24 +0200
commit6d1d223d044d2237cc9b5e0c0656bcf2ab07ae77 (patch)
tree5e43853a75044a7acad1ef48bf51b3d86c2a1d72 /src
parentMerge pull request #3091 from LogicParrot/bed (diff)
parentMoveToWorld defaults to spawnpoint (diff)
downloadcuberite-6d1d223d044d2237cc9b5e0c0656bcf2ab07ae77.tar
cuberite-6d1d223d044d2237cc9b5e0c0656bcf2ab07ae77.tar.gz
cuberite-6d1d223d044d2237cc9b5e0c0656bcf2ab07ae77.tar.bz2
cuberite-6d1d223d044d2237cc9b5e0c0656bcf2ab07ae77.tar.lz
cuberite-6d1d223d044d2237cc9b5e0c0656bcf2ab07ae77.tar.xz
cuberite-6d1d223d044d2237cc9b5e0c0656bcf2ab07ae77.tar.zst
cuberite-6d1d223d044d2237cc9b5e0c0656bcf2ab07ae77.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Entity.cpp20
-rw-r--r--src/Entities/Entity.h4
2 files changed, 21 insertions, 3 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 169bcb4de..5dcef330a 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -1584,6 +1584,24 @@ bool cEntity::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn, Vector3d
+bool cEntity::MoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn, Vector3d a_NewPosition)
+{
+ return DoMoveToWorld(a_World, a_ShouldSendRespawn, a_NewPosition);
+}
+
+
+
+
+
+bool cEntity::MoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn)
+{
+ return MoveToWorld(a_World, a_ShouldSendRespawn, Vector3d(a_World->GetSpawnX(), a_World->GetSpawnY(), a_World->GetSpawnZ()));
+}
+
+
+
+
+
bool cEntity::MoveToWorld(const AString & a_WorldName, bool a_ShouldSendRespawn)
{
cWorld * World = cRoot::Get()->GetWorld(a_WorldName);
@@ -1593,7 +1611,7 @@ bool cEntity::MoveToWorld(const AString & a_WorldName, bool a_ShouldSendRespawn)
return false;
}
- return DoMoveToWorld(World, a_ShouldSendRespawn, GetPosition());
+ return DoMoveToWorld(World, a_ShouldSendRespawn, Vector3d(World->GetSpawnX(), World->GetSpawnY(), World->GetSpawnZ()));
}
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h
index 75c77e593..b00201f3a 100644
--- a/src/Entities/Entity.h
+++ b/src/Entities/Entity.h
@@ -406,10 +406,10 @@ public:
/** Schedules a MoveToWorld call to occur on the next Tick of the entity */
void ScheduleMoveToWorld(cWorld * a_World, Vector3d a_NewPosition, bool a_SetPortalCooldown = false);
- bool MoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn, Vector3d a_NewPosition) { return DoMoveToWorld(a_World, a_ShouldSendRespawn, a_NewPosition); }
+ bool MoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn, Vector3d a_NewPosition);
/** Moves entity to specified world, taking a world pointer */
- bool MoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn = true) { return MoveToWorld(a_World, a_ShouldSendRespawn, GetPosition()); }
+ bool MoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn = true);
/** Moves entity to specified world, taking a world name */
bool MoveToWorld(const AString & a_WorldName, bool a_ShouldSendRespawn = true);