[2.0.17] cannot access character inventory of a player that is in remote view

Post your bugs and problems so we can fix them.
cogito123
Inserter
Inserter
Posts: 33
Joined: Thu Feb 28, 2019 7:05 pm
Contact:

[2.0.17] cannot access character inventory of a player that is in remote view

Post by cogito123 »

When player is in remote view, calling function LuaControl::get_inventory(defines.inventory.character_main) for LuaPlayer will return nil. This is the issue, because a lot of GUI functionality implemented in our scenario assumes inventory is always available as long as there is 'character' assigned to player. So right now, if player clicks some button that will interact with his inventory to take some stuff, his controller needs to be switched to defines.controllers.character, abruptly closing his view. The situation gets more complicated if one player wants to interact with inventory of other player.

I'd expect all these defines to return LuaInventory even in remote view, as long as player has a character.
defines.inventory.character_main
defines.inventory.character_guns
defines.inventory.character_ammo
defines.inventory.character_armor
defines.inventory.character_vehicle
defines.inventory.character_trash
Post Reply

Return to “Bug Reports”