mirror of
https://github.com/minetest/minetest.git
synced 2025-03-14 14:22:36 +01:00
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:
@ -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);
|
||||
|
Reference in New Issue
Block a user