diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2015-02-11 11:27:52 +0100 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2015-02-11 12:23:14 +0100 |
commit | a9355284b5c3726de83c6dcd6136dd1ac86e02dc (patch) | |
tree | 69d0470a867efd16807c31eda5f6a96b776ae118 /src | |
parent | 8252e1ecd097abd83a3e9ef95aba37a3d837e00b (diff) | |
download | minetest-a9355284b5c3726de83c6dcd6136dd1ac86e02dc.tar.gz minetest-a9355284b5c3726de83c6dcd6136dd1ac86e02dc.tar.bz2 minetest-a9355284b5c3726de83c6dcd6136dd1ac86e02dc.zip |
Don't permit to open inventory is playerCAO isn't present. This prevent to open an empty inventory at player load. ok @zeno-
Diffstat (limited to 'src')
-rw-r--r-- | src/game.cpp | 9 |
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); |