Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

shadowDigga

Update setcharged function definition of lightning rod and conductor

Recommended Posts

setcharged(inst, charges) function currently sets amount of charges left to amount of charges specified in function call if it was larger than remaining charges due to this line of code:

inst.chargeleft = math.max(inst.chargeleft or 0, charges)

It would've been nice to have it changed to

inst.chargeleft = (inst.chargeleft or 0) + charges

to make charges stack. It doesn't really make sense that lightning rod's own charges limit to be implicitly set by amount of charges mentioned in the only possible function call.

(Inspired by this thread)

Link to comment
Share on other sites