Summary:
entity.deplete() deletes infinite resources
To recreate: mouse over a patch of oil and do
/c game.player.selected.deplete()
What happened:
Resource is destroyed.
What was expected:
Resource remains. Is set to depletion amount.
[1.0.0] resource.deplete() destroys infinite resources
Re: [1.0.0] resource.deplete() destroys infinite resources
Seems intended, https://lua-api.factorio.com/latest/Lua ... ty.deplete:
deplete() Depletes and destroys this resource entity.
Re: [1.0.0] resource.deplete() destroys infinite resources
Ref 83231 (where it was requested).
I think it makes more sense if it is possible to deplete infinite resources, as that way the script itself can check if resource is infinite or not and decide if it wants to deplete it or not. Other reasoning would be this function removes exactly the amount that was left which in this case is infinite and leaves it at 0
I think it makes more sense if it is possible to deplete infinite resources, as that way the script itself can check if resource is infinite or not and decide if it wants to deplete it or not. Other reasoning would be this function removes exactly the amount that was left which in this case is infinite and leaves it at 0
Re: [1.0.0] resource.deplete() destroys infinite resources
Sounds reasonable... forever 0/sboskid wrote: ↑Mon Oct 19, 2020 3:11 pm Ref 83231 (where it was requested).
I think it makes more sense if it is possible to deplete infinite resources, as that way the script itself can check if resource is infinite or not and decide if it wants to deplete it or not. Other reasoning would be this function removes exactly the amount that was left which in this case is infinite and leaves it at 0
Re: [1.0.0] resource.deplete() destroys infinite resources
Thanks for the report however that's fully working as intended. Additionally you're the one who requested it to work exactly as it does.
If you don't want it to destroy the resource then don't call it The whole purpose of the function is to do exactly what it does.
If you don't want it to destroy the resource then don't call it The whole purpose of the function is to do exactly what it does.
If you want to get ahold of me I'm almost always on Discord.
Re: [1.0.0] resource.deplete() destroys infinite resources
Infinite resources can still deplete (and they fire the related event) without being destroyed via normal gameplay. I may have mistated my original request, but the goal was to recreate the vanilla behavior.