From a9355284b5c3726de83c6dcd6136dd1ac86e02dc Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Wed, 11 Feb 2015 11:27:52 +0100 Subject: 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(+) (limited to 'src') 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); -- cgit v1.2.3