minetest_game icon indicating copy to clipboard operation
minetest_game copied to clipboard

furnace "catch-up" mechanic can be cheated

Open fluxionary opened this issue 3 years ago • 1 comments

this isn't easy to replicate w/out a lot of lag, but

  1. put fuel into the furnace, start smelting/cooking something.
  2. leave the area, so the furnace unloads. wait a while.
  3. return to the area and put more stuff in the furnace
  4. when the area "loads", all of the new stuff will be smelted, including stuff that was just added to the furnace.

probably the timer should "reset" if new things are added? though i'm not quite sure how to do that. the code is already fairly complicated.

fluxionary avatar Oct 28 '22 16:10 fluxionary

I encountered the same issue when I added a catchup mechanic to the wine mod by Tenplus1. This can be fixed the problem you then have is:

If you reset the timer straight away if someone adds stuff then the items that should have legitmatly been smelted/cooked/whatevered then don't and unfortunatly this would then look like a bug to people as well.

I'm fairly sure on the wine mod but I'd have to go check my code I added an extra check if the formspec was loaded/opened and that would trigger sort of an override check and catchup/reset before a user can jam more ingredients in and get them cooked or in that case brewed for free :).

I'll see if I can get some time to get my head back around the furnace code and have a look at this I recall when I looked at the catchup code to see how it worked it had some other complexities inside it.

Do my best to keep any fix simple and then do PR.

sirrobzeroone avatar Jun 16 '23 22:06 sirrobzeroone