[1.1.6] LuaPlayer.hand_location does not account for blueprint book inventories
Posted: Wed Dec 16, 2020 6:23 pm
player.hand_location returns
inventory :: defines.inventory
slot :: uint
If you access hand_location whilst holding a blueprint in the 3rd slot of a blueprint book in the players inventory then it will have inventory = 1, slot = 3. If you then write that same information back to player.hand_location it will not behave as expected (and crash if there is already an item in the 3rd slot of the player's inventory).
This means that in certain situations will cause the mod to crash.
inventory :: defines.inventory
slot :: uint
If you access hand_location whilst holding a blueprint in the 3rd slot of a blueprint book in the players inventory then it will have inventory = 1, slot = 3. If you then write that same information back to player.hand_location it will not behave as expected (and crash if there is already an item in the 3rd slot of the player's inventory).
This means that in certain situations
Code: Select all
player.hand_location = player.hand_location