From ab7d011afdde22acf85708fccc5e7eb553b45fe3 Mon Sep 17 00:00:00 2001 From: mrkubax10 Date: Mon, 10 Mar 2025 11:06:38 +0100 Subject: [PATCH] Remove redundant return value from `ActivatedMachine.activeUpdate` --- machines/activated_machine.lua | 5 ++--- machines/canning_machine.lua | 4 ++-- machines/generator.lua | 4 +--- machines/iron_furnace.lua | 4 +--- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/machines/activated_machine.lua b/machines/activated_machine.lua index f52c9f5..dd18bbe 100644 --- a/machines/activated_machine.lua +++ b/machines/activated_machine.lua @@ -95,7 +95,6 @@ end function industrialtest.ActivatedMachine.activeOnTimer(self,pos,elapsed) local meta=minetest.get_meta(pos) local inv=meta:get_inventory() - local shouldRerunTimer=false local shouldUpdateFormspec=false if self:shouldDeactivate(pos) then @@ -104,12 +103,12 @@ function industrialtest.ActivatedMachine.activeOnTimer(self,pos,elapsed) end if self.activeUpdate then - shouldRerunTimer,shouldUpdateFormspec=self:activeUpdate(pos,elapsed,meta,inv) + shouldUpdateFormspec=self:activeUpdate(pos,elapsed,meta,inv) end if shouldUpdateFormspec then self:updateFormspec(pos) end - return shouldRerunTimer + return true end diff --git a/machines/canning_machine.lua b/machines/canning_machine.lua index a9020ea..d8f2fa4 100644 --- a/machines/canning_machine.lua +++ b/machines/canning_machine.lua @@ -216,7 +216,7 @@ function industrialtest.CanningMachine.activeUpdate(self,pos,elapsed,meta,inv) local def=fuelSlot:get_definition() local leftoverSlot=inv:get_stack("leftover",1) if targetMeta:get_int("industrialtest.fluidCapacity")-targetMeta:get_int("industrialtest.fluidAmount")0 and meta:get_float("fuelTime")<=0 and not industrialtest.api.isFullyCharged(meta) then local output,after=minetest.get_craft_result({ @@ -114,10 +113,9 @@ function industrialtest.Generator.activeUpdate(self,pos,elapsed,meta,inv) meta:set_float("fuelTime",meta:get_float("fuelTime")-elapsed) industrialtest.api.addPower(meta,200) shouldUpdateFormspec=true - shouldRerunTimer=true end - return shouldRerunTimer,shouldUpdateFormspec + return shouldUpdateFormspec end function industrialtest.Generator.shouldActivate(self,pos) diff --git a/machines/iron_furnace.lua b/machines/iron_furnace.lua index 56fc7fa..5b133d1 100644 --- a/machines/iron_furnace.lua +++ b/machines/iron_furnace.lua @@ -164,7 +164,6 @@ function industrialtest.IronFurnace.activeUpdate(self,pos,elapsed,meta,inv) local srcSlot=inv:get_stack("src",1) local fuelSlot=inv:get_stack("fuel",1) local shouldUpdateFormspec=false - local shouldRerunTimer=false if fuelSlot:get_count()>0 and meta:get_float("fuelTime")<=0 then local output,after=minetest.get_craft_result({ @@ -202,7 +201,6 @@ function industrialtest.IronFurnace.activeUpdate(self,pos,elapsed,meta,inv) end meta:set_float("fuelTime",meta:get_float("fuelTime")-elapsed) shouldUpdateFormspec=true - shouldRerunTimer=true end if meta:get_float("srcTime")>=meta:get_float("maxSrcTime") then local output,after=minetest.get_craft_result({ @@ -218,7 +216,7 @@ function industrialtest.IronFurnace.activeUpdate(self,pos,elapsed,meta,inv) end end - return shouldRerunTimer,shouldUpdateFormspec + return shouldUpdateFormspec end function industrialtest.IronFurnace.shouldActivate(self,pos)