summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLane Kolbly <lane@rscheme.org>2017-08-30 01:35:53 +0200
committerSafwat Halaby <LogicParrot@users.noreply.github.com>2017-08-30 01:35:53 +0200
commit1f9788a80119814d1082015479731291a9cbfbad (patch)
tree9d7942f04b364221474135327c35b34af072d9be
parentcUUID: Fix FromHexDigit for digits >= 'a' (diff)
downloadcuberite-1f9788a80119814d1082015479731291a9cbfbad.tar
cuberite-1f9788a80119814d1082015479731291a9cbfbad.tar.gz
cuberite-1f9788a80119814d1082015479731291a9cbfbad.tar.bz2
cuberite-1f9788a80119814d1082015479731291a9cbfbad.tar.lz
cuberite-1f9788a80119814d1082015479731291a9cbfbad.tar.xz
cuberite-1f9788a80119814d1082015479731291a9cbfbad.tar.zst
cuberite-1f9788a80119814d1082015479731291a9cbfbad.zip
-rw-r--r--Server/Plugins/APIDump/APIDesc.lua7
-rw-r--r--src/Entities/Entity.cpp5
-rw-r--r--src/Entities/Entity.h3
3 files changed, 11 insertions, 4 deletions
diff --git a/Server/Plugins/APIDump/APIDesc.lua b/Server/Plugins/APIDump/APIDesc.lua
index 674729624..9a0b7a36e 100644
--- a/Server/Plugins/APIDump/APIDesc.lua
+++ b/Server/Plugins/APIDump/APIDesc.lua
@@ -3946,8 +3946,13 @@ local Hash = cCryptoHash.sha1HexString("DataToHash")
Type = "boolean",
IsOptional = true,
},
+ {
+ Name = "ShouldSendRespawn",
+ Type = "boolean",
+ IsOptional = true,
+ },
},
- Notes = "Schedules a MoveToWorld call to occur on the next Tick of the entity. If ShouldSetPortalCooldown is false (default), doesn't set any portal cooldown, if it is true, the default portal cooldown is applied to the entity.",
+ Notes = "Schedules a MoveToWorld call to occur on the next Tick of the entity. If ShouldSetPortalCooldown is false (default), doesn't set any portal cooldown, if it is true, the default portal cooldown is applied to the entity. If ShouldSendRespawn is false (default), no respawn packet is sent, if it is true then a respawn packet is sent to the client.",
},
SetGravity =
{
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 347c0ec91..836e69961 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -1353,12 +1353,13 @@ void cEntity::DetectCacti(void)
-void cEntity::ScheduleMoveToWorld(cWorld * a_World, Vector3d a_NewPosition, bool a_SetPortalCooldown)
+void cEntity::ScheduleMoveToWorld(cWorld * a_World, Vector3d a_NewPosition, bool a_SetPortalCooldown, bool a_ShouldSendRespawn)
{
m_NewWorld = a_World;
m_NewWorldPosition = a_NewPosition;
m_IsWorldChangeScheduled = true;
m_WorldChangeSetPortalCooldown = a_SetPortalCooldown;
+ m_WorldChangeSendRespawn = a_ShouldSendRespawn;
}
@@ -1378,7 +1379,7 @@ bool cEntity::DetectPortal()
m_PortalCooldownData.m_ShouldPreventTeleportation = true;
}
- MoveToWorld(m_NewWorld, false, m_NewWorldPosition);
+ MoveToWorld(m_NewWorld, m_WorldChangeSendRespawn, m_NewWorldPosition);
return true;
}
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h
index ace2eb6d7..d143e3814 100644
--- a/src/Entities/Entity.h
+++ b/src/Entities/Entity.h
@@ -428,7 +428,7 @@ public:
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 a_ShouldSetPortalCooldown = false);
+ void ScheduleMoveToWorld(cWorld * a_World, Vector3d a_NewPosition, bool a_ShouldSetPortalCooldown = false, bool a_ShouldSendRespawn = false);
bool MoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn, Vector3d a_NewPosition);
@@ -592,6 +592,7 @@ protected:
/** State variables for ScheduleMoveToWorld. */
bool m_IsWorldChangeScheduled;
bool m_WorldChangeSetPortalCooldown;
+ bool m_WorldChangeSendRespawn;
cWorld * m_NewWorld;
Vector3d m_NewWorldPosition;