Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarWorldClient.cpp
diff options
context:
space:
mode:
authorlonaasan <shadowlona@shadowlona.dev>2024-09-09 11:27:14 +0200
committerlonaasan <shadowlona@shadowlona.dev>2024-09-09 11:27:14 +0200
commit732fc2a9d7e9a4c5e3cf01ac191a392462f3da8c (patch)
tree5f6764ac49aec0a20bd45add222b0409f7f0a55f /source/game/StarWorldClient.cpp
parent98a395721ee0383bd2ed046235dd644909f2f943 (diff)
[Revision] Applying the recommended changes from pull request #110 (return current value if no argument given, moving the methods to their correct location)
Diffstat (limited to 'source/game/StarWorldClient.cpp')
-rw-r--r--source/game/StarWorldClient.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/source/game/StarWorldClient.cpp b/source/game/StarWorldClient.cpp
index afe71ac..0d3e039 100644
--- a/source/game/StarWorldClient.cpp
+++ b/source/game/StarWorldClient.cpp
@@ -142,6 +142,16 @@ bool WorldClient::respawnInWorld() const {
return m_respawnInWorld;
}
+bool WorldClient::setRespawnInWorld(bool value = NULL) {
+
+ if (value != NULL)
+ m_respawnInWorld = value;
+ else
+ m_respawnInWorld ^= true; // dont know if we still want to set the respawn if no argument is given here
+
+ return m_respawnInWorld;
+}
+
void WorldClient::removeEntity(EntityId entityId, bool andDie) {
auto entity = m_entityMap->entity(entityId);
if (!entity)
@@ -2421,16 +2431,4 @@ void WorldClient::setupForceRegions() {
}
}
-bool WorldClient::toggleRespawnInWorld() {
- // Setting oldValue to check if m_respawnInWorld triggered correctly later
- const bool oldValue = respawnInWorld();
-
- m_respawnInWorld ^= true;
-
- if (respawnInWorld() != oldValue) {
- return true;
- }
- return false;
-}
-
}