furnace: missing 'sanity' check

Post Reply
User avatar
rnd
Member
Posts: 220
Joined: Sun Dec 28, 2014 12:24
GitHub: ac-minetest
IRC: ac_minetest
In-game: rnd

furnace: missing 'sanity' check

by rnd » Post

PROBLEM:
1. suppose you have item with long burn time that requires a lot of fuel.

2. put item in chest, add any fuel (1 piece of wood will do) and quickly go away so that area unloads.
wait however long is needed for smelting

3. come back.. your item is magically smelted, even though the fuel was clearly not sufficient (need to add missing FUEL CHECK here)

furnace.lua:

Code: Select all

minetest.register_node("default:furnace", {
...
on_timer = furnace_node_timer,
...
}

local function furnace_node_timer(pos, elapsed)

...
if fuel_time < fuel_totaltime then
	-- The furnace is currently active and has enough fuel
	fuel_time = fuel_time + elapsed
        if cookable then
	    src_time = src_time + elapsed
	   if src_time >= cooked.time then
               -- Place result in dst list if possible
              PROBLEM HERE, MISSING FUEL CHECK
FIX: check if fuel.time is enough to smelt item or abort smelt process.
1EvCmxbzl5KDu6XAunE1K853Lq6VVOsT

sfan5
Moderator
Posts: 4095
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: furnace: missing 'sanity' check

by sfan5 » Post

You should open an issue here.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
sorcerykid
Member
Posts: 1847
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: furnace: missing 'sanity' check

by sorcerykid » Post

Thanks for the heads up rnd. I will go ahead and put a fix into place on my server. Hopefully other server operators will see this report and do the same.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: furnace: missing 'sanity' check

by sofar » Post

Please take the time and share your fix, so it can be fixed in the various forks of minetest_game?

User avatar
Wuzzy
Member
Posts: 4803
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: furnace: missing 'sanity' check

by Wuzzy » Post

Sorcerykid is usually not interested in sharing anything. We're on our own.

Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests