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

summaryrefslogtreecommitdiff
path: root/source/game/StarUniverseClient.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-03-09 11:09:04 +1100
committerKae <80987908+Novaenia@users.noreply.github.com>2024-03-09 11:09:04 +1100
commit165bcbefee1c6c0f73553190ecffadcfdf40f16d (patch)
tree85b7cfb6ea89c04c80cc2d199a47e0be9a528670 /source/game/StarUniverseClient.cpp
parent52a6f200ed1613ea888db9885f1a27c1c975a7d2 (diff)
minor code polish
Diffstat (limited to 'source/game/StarUniverseClient.cpp')
-rw-r--r--source/game/StarUniverseClient.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/game/StarUniverseClient.cpp b/source/game/StarUniverseClient.cpp
index 72dd6a0..7d455ba 100644
--- a/source/game/StarUniverseClient.cpp
+++ b/source/game/StarUniverseClient.cpp
@@ -574,8 +574,10 @@ bool UniverseClient::switchPlayer(size_t index) {
bool UniverseClient::switchPlayer(String const& name) {
if (auto uuid = m_playerStorage->playerUuidByName(name, mainPlayer()->uuid()))
return switchPlayer(*uuid);
- else
+ else if (name.utf8Size() == UuidSize * 2)
return switchPlayer(Uuid(name));
+ else
+ return false;
}
UniverseClient::ReloadPlayerCallback& UniverseClient::playerReloadPreCallback() {