Page 1 of 1

[0.13.11] Cannot set durability to 0

Posted: Tue Jul 26, 2016 4:17 pm
by theRustyKnife
When I try to set the durability of a LuaItemStack to 0, I get an error saying that it has to be greater than or equal to zero.
This in the console causes it too (if you have an apropriate item in the first slot obviously ;)):

Code: Select all

/c game.player.get_inventory(defines.inventory.player_main)[1].durability = 0
I'm not sure if you're actually supposed to be able to do it, but even if not it would be good to at least change the error message.

Re: [0.13.11] Cannot set durability to 0

Posted: Tue Jul 26, 2016 4:56 pm
by Rseding91
It should state that it has to be larger than 0.

If you want to set it to 0 just set it to default and reduce the count by 1.

Re: [0.13.11] Cannot set durability to 0

Posted: Tue Jul 26, 2016 5:18 pm
by theRustyKnife
Rseding91 wrote:It should state that it has to be larger than 0.

If you want to set it to 0 just set it to default and reduce the count by 1.
That's what I thought. It's just the error message wrong then?

Re: [0.13.11] Cannot set durability to 0

Posted: Tue Jul 26, 2016 5:36 pm
by Rseding91
yes

Re: [0.13.11] Cannot set durability to 0

Posted: Wed Jul 27, 2016 9:02 am
by Rseding91
Fixed for 0.13.12.