Oxygenerator error [Fixed]

Post Reply
User avatar
ManElevation
Member
Posts: 896
Joined: Tue Aug 02, 2016 22:04
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

Oxygenerator error [Fixed]

by ManElevation » Post

Heyaii!
I'm working on a new update on my new mod Oxygenerators
Image
the update consist on making the oxygenerator need fuel to activate
so it works like a furnace when there is fuel it burns it and swaps the node from oxygenerator:oxygenerator_small to oxygenerator:oxygenerator_small_active

The problem is that it's not swapping the node or burning the fuel when there is fuel.
no errors on debug.txt and here is where I think the problem is....

Code: Select all

local function oxygenerator_node_timer(pos)
    --
    -- Update formspec, infotext and node
    -- oxygenerate_fuel
    local timer = minetest.get_node_timer(pos)
    local meta = minetest.get_meta(pos)
    local inv = meta:get_inventory()
    local stack = ItemStack("oxygenerator:air_tank 1")
    local fuel = inv:contains_item("fuel", stack) -- nil if not true
    local node = minetest.get_node(pos)

    if fuel then
	minetest.get_node_timer(pos):start(1)
        if timer:is_started() == false then
            timer:start(oxygenerator.consume_rate)
            minetest.get_node_timer(pos):start(1)
        inv:remove_item("fuel", stack)
        minetest.swap_node(pos, {name="oxygenerator:oxygenerator_small_active"})
        end
    else
    minetest.swap_node(pos, {name="oxygenerator:oxygenerator_small", param2=node.param2})
        meta:set_string("infotext", "Insert Air tanks as fuel12.")
        --
        --
        -- stop timer on the inactive oxygenerator
        timer:stop()
end
end
here is the whole mod maybe it might help so u guys can test it.
Download: https://github.com/ManElevation/oxygeneratorerror
Last edited by ManElevation on Wed Sep 12, 2018 19:40, edited 1 time in total.
My Public Mods! Discord: Rottweiler Games#3368

User avatar
ManElevation
Member
Posts: 896
Joined: Tue Aug 02, 2016 22:04
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

Re: Oxygenerator error

by ManElevation » Post

Fixed
My Public Mods! Discord: Rottweiler Games#3368

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests