From a9355284b5c3726de83c6dcd6136dd1ac86e02dc Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Wed, 11 Feb 2015 11:27:52 +0100 Subject: [PATCH] Don't permit to open inventory is playerCAO isn't present. This prevent to open an empty inventory at player load. ok @zeno- --- src/game.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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); -- 2.25.1