Page 1 of 1

[0.17.23]LuaCharacter.set_request_slot() inconsistency and typo

Posted: Fri Mar 29, 2019 10:07 pm
by Choumiko
LuaCharacter.set_request_slot() doesn't let you set 0 as the requested amount, whereas you can set a 0 request via the GUI just fine.

To reproduce:

Code: Select all

/c game.player.character.set_request_slot({name="wood", count=0}, 1)
Results in an error:
Cannot execute command. Error: Item stack count has to a be positive number
The message should be "has to be a" and not "has to a be"

I'd expect the call to work even when count is 0.
But reading the error it might actually be because the implementation of item stack doesn't allow count to be 0, which makes sense i guess.

Re: [0.17.23]LuaCharacter.set_request_slot() inconsistency and typo

Posted: Sun Mar 31, 2019 4:44 am
by Rseding91
Thanks for the report. It's now fixed for the next version of 0.17.