Page 1 of 1

[1.0.0]LuaControl.set_personal_logistic_slot strange behavior

Posted: Sun Nov 01, 2020 8:02 pm
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

Re: [1.0.0]LuaControl.set_personal_logistic_slot strange behavior

Posted: Sun Nov 01, 2020 8:35 pm
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.