projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8252e1e
)
Don't permit to open inventory is playerCAO isn't present. This prevent to open an...
2183/head
author
Loic Blot
<loic.blot@unix-experience.fr>
Wed, 11 Feb 2015 10:27:52 +0000
(11:27 +0100)
committer
Loic Blot
<loic.blot@unix-experience.fr>
Wed, 11 Feb 2015 11:23:14 +0000
(12:23 +0100)
src/game.cpp
patch
|
blob
|
history
diff --git
a/src/game.cpp
b/src/game.cpp
index a1e2b807a28ce86aecfa1956d0f727491f7864ee..186e283adb1478dfabbc0ac46f4a8342054cbaed 100644
(file)
--- 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);