LuaIttemStack.drain/add_durability

User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 260
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

LuaIttemStack.drain/add_durability

Post by theRustyKnife »

I'm sorry to bother again, but it would be really nice to have the functions to add and drain durability of a LuaItemStack, similar to what ammo has. I mean... It's possible to go without it, but it would make things much easier.
I would be ok if you didn't do this since I feel like I'm the only one messing with durability :D, but it would be nice.
Thanks TRK
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: LuaIttemStack.drain/add_durability

Post by aubergine18 »

Isn't that already implemented? viewtopic.php?f=65&t=29898
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 260
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

Re: LuaIttemStack.drain/add_durability

Post by theRustyKnife »

Well, it's possible that they implemented this too, but it's not the same suggestion. What I asked before was to expose the durability of an item prototype, whereas here I'm talking about a completely different class (is it actually a class in lua?).
Essentially, I'd like durability to have the same options as ammo has - read/write from/to a stack, read the prototype definition, methods to drain and add to a stack.
But as I said, it's possible (although not too convenient) to work without it, so it's no high priority or anything ;).
Rseding91
Factorio Staff
Factorio Staff
Posts: 15997
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LuaIttemStack.drain/add_durability

Post by Rseding91 »

Added for 0.13.12.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Implemented mod requests”