diff --git a/source/frontend/StarMainInterface.cpp b/source/frontend/StarMainInterface.cpp index 4485ffa..2be8c2e 100644 --- a/source/frontend/StarMainInterface.cpp +++ b/source/frontend/StarMainInterface.cpp @@ -96,7 +96,8 @@ MainInterface::MainInterface(UniverseClientPtr client, WorldPainterPtr painter, m_inventoryWindow = make_shared(this, m_client->mainPlayer(), m_containerInteractor); m_paneManager.registerPane(MainInterfacePanes::Inventory, PaneLayer::Window, m_inventoryWindow, [this](PanePtr const&) { - m_client->mainPlayer()->clearSwap(); + if (auto player = m_client->mainPlayer()) + player->clearSwap(); if (m_containerPane) { m_containerPane->dismiss(); m_containerPane = {}; @@ -216,7 +217,8 @@ void MainInterface::openCraftingWindow(Json const& config, EntityId sourceEntity m_craftingWindow = make_shared(m_client->worldClient(), m_client->mainPlayer(), config, sourceEntityId); m_paneManager.displayPane(PaneLayer::Window, m_craftingWindow, [this](PanePtr const&) { - m_client->mainPlayer()->clearSwap(); + if (auto player = m_client->mainPlayer()) + player->clearSwap(); }); } @@ -233,7 +235,8 @@ void MainInterface::openMerchantWindow(Json const& config, EntityId sourceEntity m_paneManager.displayPane(PaneLayer::Window, m_merchantWindow, [this](PanePtr const&) { - m_client->mainPlayer()->clearSwap(); + if (auto player = m_client->mainPlayer()) + player->clearSwap(); m_paneManager.dismissRegisteredPane(MainInterfacePanes::Inventory); }); m_paneManager.displayRegisteredPane(MainInterfacePanes::Inventory); @@ -401,7 +404,8 @@ void MainInterface::handleInteractAction(InteractAction interactAction) { m_containerPane = make_shared(world, m_client->mainPlayer(), m_containerInteractor); m_paneManager.displayPane(PaneLayer::Window, m_containerPane, [this](PanePtr const&) { - m_client->mainPlayer()->clearSwap(); + if (auto player = m_client->mainPlayer()) + player->clearSwap(); m_paneManager.dismissRegisteredPane(MainInterfacePanes::Inventory); }); @@ -496,7 +500,8 @@ void MainInterface::handleInteractAction(InteractAction interactAction) { if (scriptPane->openWithInventory()) { m_paneManager.displayPane(PaneLayer::Window, scriptPane, [this](PanePtr const&) { - m_client->mainPlayer()->clearSwap(); + if (auto player = m_client->mainPlayer()) + player->clearSwap(); m_paneManager.dismissRegisteredPane(MainInterfacePanes::Inventory); }); m_paneManager.displayRegisteredPane(MainInterfacePanes::Inventory); diff --git a/source/game/StarPlayer.cpp b/source/game/StarPlayer.cpp index 47ded48..8d0ece5 100644 --- a/source/game/StarPlayer.cpp +++ b/source/game/StarPlayer.cpp @@ -1759,7 +1759,6 @@ void Player::getNetStates(bool initial) { if (m_identityNetState.pullUpdated()) { m_identity = m_identityNetState.get(); - m_identityUpdated = true; m_humanoid->setIdentity(m_identity); }