aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index a1e2b807a..186e283ad 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -2669,6 +2669,15 @@ void Game::dropSelectedItem()
void Game::openInventory()
{
+ /*
+ * Don't permit to open inventory is CAO or player doesn't exists.
+ * This prevent showing an empty inventory at player load
+ */
+
+ LocalPlayer *player = client->getEnv().getLocalPlayer();
+ if (player == NULL || player->getCAO() == NULL)
+ return;
+
infostream << "the_game: " << "Launching inventory" << std::endl;
PlayerInventoryFormSource *fs_src = new PlayerInventoryFormSource(client);