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

summaryrefslogtreecommitdiff
path: root/source/game/StarUniverseClient.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-07-29 02:12:03 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-07-29 02:12:03 +1000
commit224ad2c2c07311475875d1d243354f8647112b45 (patch)
treec8247f22b4ddda345b7f35d7c6ead25d5e1f2791 /source/game/StarUniverseClient.cpp
parent35fc2679dea7b625bf559c6855e101fc62e613f4 (diff)
Reset script panes on character swap
Diffstat (limited to 'source/game/StarUniverseClient.cpp')
-rw-r--r--source/game/StarUniverseClient.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/game/StarUniverseClient.cpp b/source/game/StarUniverseClient.cpp
index f12ae28..c17f8bc 100644
--- a/source/game/StarUniverseClient.cpp
+++ b/source/game/StarUniverseClient.cpp
@@ -477,7 +477,7 @@ void UniverseClient::stopLua() {
m_scriptContexts.clear();
}
-bool UniverseClient::reloadPlayer(Json const& data, Uuid const& uuid) {
+bool UniverseClient::reloadPlayer(Json const& data, Uuid const& uuid, bool resetInterfaces) {
auto player = mainPlayer();
bool playerInWorld = player->inWorld();
auto world = as<WorldClient>(player->world());
@@ -487,7 +487,7 @@ bool UniverseClient::reloadPlayer(Json const& data, Uuid const& uuid) {
: connectionEntitySpace(world->connection()).first;
if (m_playerReloadPreCallback)
- m_playerReloadPreCallback();
+ m_playerReloadPreCallback(resetInterfaces);
if (playerInWorld) {
world->removeEntity(player->entityId(), false);
@@ -515,7 +515,7 @@ bool UniverseClient::reloadPlayer(Json const& data, Uuid const& uuid) {
player->universeMap()->filterMappedObjects(coordinate, m_systemWorldClient->objectKeys());
if (m_playerReloadCallback)
- m_playerReloadCallback();
+ m_playerReloadCallback(resetInterfaces);
if (exception)
std::rethrow_exception(exception);
@@ -527,7 +527,7 @@ bool UniverseClient::switchPlayer(Uuid const& uuid) {
if (uuid == mainPlayer()->uuid())
return false;
else if (auto data = m_playerStorage->maybeGetPlayerData(uuid))
- return reloadPlayer(*data, uuid);
+ return reloadPlayer(*data, uuid, true);
else
return false;
}
@@ -546,11 +546,11 @@ bool UniverseClient::switchPlayer(String const& name) {
return false;
}
-UniverseClient::Callback& UniverseClient::playerReloadPreCallback() {
+UniverseClient::ReloadPlayerCallback& UniverseClient::playerReloadPreCallback() {
return m_playerReloadPreCallback;
}
-UniverseClient::Callback& UniverseClient::playerReloadCallback() {
+UniverseClient::ReloadPlayerCallback& UniverseClient::playerReloadCallback() {
return m_playerReloadCallback;
}