Don't permit to open inventory is playerCAO isn't present. This prevent to open an empty inventory at player load. ok @zeno-

This commit is contained in:
Loic Blot 2015-02-11 11:27:52 +01:00
parent 8252e1ecd0
commit a9355284b5
1 changed files with 9 additions and 0 deletions

View File

@ -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);