summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.h
diff options
context:
space:
mode:
authorLane Kolbly <lane@rscheme.org>2015-05-27 03:35:28 +0200
committerLane Kolbly <lane@rscheme.org>2015-06-10 01:23:57 +0200
commit73b6a44d5f9e35f7471b7e86e4fd5ee463b2ea44 (patch)
treeb4871bdf502c91912f99bb9ab00788e17bccd7ef /src/Entities/Entity.h
parentMerge pull request #2221 from mc-server/AreaCountBlocks (diff)
downloadcuberite-73b6a44d5f9e35f7471b7e86e4fd5ee463b2ea44.tar
cuberite-73b6a44d5f9e35f7471b7e86e4fd5ee463b2ea44.tar.gz
cuberite-73b6a44d5f9e35f7471b7e86e4fd5ee463b2ea44.tar.bz2
cuberite-73b6a44d5f9e35f7471b7e86e4fd5ee463b2ea44.tar.lz
cuberite-73b6a44d5f9e35f7471b7e86e4fd5ee463b2ea44.tar.xz
cuberite-73b6a44d5f9e35f7471b7e86e4fd5ee463b2ea44.tar.zst
cuberite-73b6a44d5f9e35f7471b7e86e4fd5ee463b2ea44.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Entity.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h
index 58d1287e7..8d1d62ddf 100644
--- a/src/Entities/Entity.h
+++ b/src/Entities/Entity.h
@@ -392,15 +392,20 @@ public:
/// Teleports to the coordinates specified
virtual void TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ);
+ /// Schedules a MoveToWorld call to occur on the next Tick of the entity
+ void ScheduleMoveToWorld(cWorld * a_World, Vector3d a_NewPosition);
+
+ bool MoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn, Vector3d a_NewPosition) { return DoMoveToWorld(a_World, a_ShouldSendRespawn, a_NewPosition); }
+
/** Moves entity to specified world, taking a world pointer */
- bool MoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn = true) { return DoMoveToWorld(a_World, a_ShouldSendRespawn); }
+ bool MoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn = true) { return MoveToWorld(a_World, a_ShouldSendRespawn, GetPosition()); }
/** Moves entity to specified world, taking a world name */
bool MoveToWorld(const AString & a_WorldName, bool a_ShouldSendRespawn = true);
// tolua_end
- virtual bool DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn);
+ virtual bool DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn, Vector3d a_NewPosition);
/** Returns if the entity is travelling away from a specified world */
bool IsWorldTravellingFrom(cWorld * a_World) const { return (m_WorldTravellingFrom == a_World); }
@@ -530,23 +535,28 @@ protected:
eEntityType m_EntityType;
cWorld * m_World;
+
+ /** State variables for ScheduleMoveToWorld. */
+ bool m_IsWorldChangeScheduled;
+ cWorld * m_NewWorld;
+ Vector3d m_NewWorldPosition;
- /// Whether the entity is capable of taking fire or lava damage.
+ /** Whether the entity is capable of taking fire or lava damage. */
bool m_IsFireproof;
- /// Time, in ticks, since the last damage dealt by being on fire. Valid only if on fire (IsOnFire())
+ /** Time, in ticks, since the last damage dealt by being on fire. Valid only if on fire (IsOnFire()) */
int m_TicksSinceLastBurnDamage;
- /// Time, in ticks, since the last damage dealt by standing in lava. Reset to zero when moving out of lava.
+ /** Time, in ticks, since the last damage dealt by standing in lava. Reset to zero when moving out of lava. */
int m_TicksSinceLastLavaDamage;
- /// Time, in ticks, since the last damage dealt by standing in fire. Reset to zero when moving out of fire.
+ /** Time, in ticks, since the last damage dealt by standing in fire. Reset to zero when moving out of fire. */
int m_TicksSinceLastFireDamage;
- /// Time, in ticks, until the entity extinguishes its fire
+ /** Time, in ticks, until the entity extinguishes its fire */
int m_TicksLeftBurning;
- /// Time, in ticks, since the last damage dealt by the void. Reset to zero when moving out of the void.
+ /** Time, in ticks, since the last damage dealt by the void. Reset to zero when moving out of the void. */
int m_TicksSinceLastVoidDamage;
/** Does the actual speed-setting. The default implementation just sets the member variable value;