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

summaryrefslogtreecommitdiff
path: root/source/frontend/StarCharSelection.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-06-25 19:56:19 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2024-06-25 19:56:19 +1000
commit67c7257c3b7363f51ef27d8357798f799ad2c8b9 (patch)
tree11d21cb66a66c864498d941e7c9d5b1a75b79631 /source/frontend/StarCharSelection.cpp
parentc046bd83d1cd31a444c75bb70fab14e045fe7254 (diff)
Update StarCharSelection.cpp
Diffstat (limited to 'source/frontend/StarCharSelection.cpp')
-rw-r--r--source/frontend/StarCharSelection.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/source/frontend/StarCharSelection.cpp b/source/frontend/StarCharSelection.cpp
index ba750b6..50b527d 100644
--- a/source/frontend/StarCharSelection.cpp
+++ b/source/frontend/StarCharSelection.cpp
@@ -77,14 +77,15 @@ void CharSelectionPane::updateCharacterPlates() {
auto updatePlayerLine = [this](String name, unsigned scrollPosition) {
auto charSelector = fetchChild<LargeCharPlateWidget>(name);
if (auto playerUuid = m_playerStorage->playerUuidAt(scrollPosition)) {
- auto player = m_playerStorage->loadPlayer(*playerUuid);
- player->humanoid()->setFacingDirection(Direction::Right);
- charSelector->setPlayer(player);
- charSelector->enableDelete([this, playerUuid](Widget*) { m_deleteCallback(*playerUuid); });
- } else {
- charSelector->setPlayer(PlayerPtr());
- charSelector->disableDelete();
+ if (auto player = m_playerStorage->loadPlayer(*playerUuid)) {
+ player->humanoid()->setFacingDirection(Direction::Right);
+ charSelector->setPlayer(player);
+ charSelector->enableDelete([this, playerUuid](Widget*) { m_deleteCallback(*playerUuid); });
+ return;
+ }
}
+ charSelector->setPlayer(PlayerPtr());
+ charSelector->disableDelete();
};
updatePlayerLine("charSelector1", m_downScroll + 0);