Skip to content
Snippets Groups Projects
Commit a9355284 authored by Loïc Blot's avatar Loïc Blot
Browse files

Don't permit to open inventory is playerCAO isn't present. This prevent to...

Don't permit to open inventory is playerCAO isn't present. This prevent to open an empty inventory at player load. ok @zeno-
parent 8252e1ec
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment