[1.0.0]LuaControl.set_personal_logistic_slot strange behavior

This subforum contains all the issues which we already resolved.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

[1.0.0]LuaControl.set_personal_logistic_slot strange behavior

Post by Choumiko »

LuaControl.set_personal_logistic_slot is behaving kind of strange/unexpected:

It seems like it only returns true and updates the UI when min and max are different to the value that was set previously.
If only min changes, then it returns false, but the value is set anyways without updating the UI
If only max changes, it returns false and doesn't update anything

To reproduce:
- start a new game
- /cheat to unlock logistic requests
- open Character gui, logistics tab
- In the console run the following commands:

Code: Select all

/c game.print(serpent.line(game.player.set_personal_logistic_slot(1, {name = "wooden-chest", min = 0, max = 1000})))
prints true, character ui updates

Only changing min

Code: Select all

/c game.print(serpent.line(game.player.set_personal_logistic_slot(1, {name = "wooden-chest", min = 10, max = 1000})))
prints false, button turns red but the numbers stay at 0 and 1k

- Close/Open the ui: numbers are updated

Only changing max

Code: Select all

/c game.print(serpent.line(game.player.set_personal_logistic_slot(1, {name = "wooden-chest", min = 10, max = 2000})))
prints false, numbers stay the same, closing/opening doesn't help

Only changing min and max (since the last command didn't work max is still at 1k)

Code: Select all

/c game.print(serpent.line(game.player.set_personal_logistic_slot(1, {name = "wooden-chest", min = 15, max = 2000})))
prints true, gui updates

Only changing min

Code: Select all

/c game.print(serpent.line(game.player.set_personal_logistic_slot(1, {name = "wooden-chest", min = 0, max = 2000})))
prints false, button turns to default color, numbers stay at 15 and 2k

- Close/Open the ui: numbers are updated

Changing min and max

Code: Select all

/c game.print(serpent.line(game.player.set_personal_logistic_slot(1, {name = "wooden-chest", min = 10, max = 1000})))
prints true, ui updates

Expected behavior: Just work :D
- Update the values even when only one of them changes, in that case return true and update the UI
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4080
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.0.0]LuaControl.set_personal_logistic_slot strange behavior

Post by boskid »

Thanks for the report, however there were some changes already done around personal logistics, one of which fixed those issues. This is already resolved for 1.1. Tested all the commands and they just work and all printed true.
Post Reply

Return to “Resolved Problems and Bugs”