Fix some oversights

This commit is contained in:
mrkubax10 2025-01-08 22:46:16 +01:00
parent 752fe4f192
commit 6934a8b342
2 changed files with 13 additions and 13 deletions

View File

@ -85,14 +85,6 @@ function industrialtest.ActivatedMachine.activeOnTimer(self,pos,elapsed)
local shouldRerunTimer=false
local shouldUpdateFormspec=false
if self.activeUpdate then
shouldRerunTimer,shouldUpdateFormspec=self:activeUpdate(pos,elapsed,meta,inv)
end
if shouldUpdateFormspec then
self:updateFormspec(pos)
end
if self:shouldDeactivate(pos) then
minetest.swap_node(pos,{
name=self.name,
@ -103,5 +95,13 @@ function industrialtest.ActivatedMachine.activeOnTimer(self,pos,elapsed)
return false
end
if self.activeUpdate then
shouldRerunTimer,shouldUpdateFormspec=self:activeUpdate(pos,elapsed,meta,inv)
end
if shouldUpdateFormspec then
self:updateFormspec(pos)
end
return shouldRerunTimer
end

View File

@ -41,10 +41,10 @@ function industrialtest.ElectricMachine.onConstruct(self,pos)
end
end
end
end
if self.hasPowerOutput then
meta:set_string("industrialtest.network",minetest.serialize(industrialtest.api.createNetworkMap(pos)))
end
end
industrialtest.Machine.onConstruct(self,pos)
end
@ -82,7 +82,7 @@ function industrialtest.ElectricMachine.onTimer(self,pos,elapsed)
return result or result2
end
function industrialtest.Machine.allowMetadataInventoryMove(self,pos,fromList,fromIndex,toList,toIndex,count)
function industrialtest.ElectricMachine.allowMetadataInventoryMove(self,pos,fromList,fromIndex,toList,toIndex,count)
local found=false
if self.powerLists then
for _,value in ipairs(self.powerLists) do
@ -99,7 +99,7 @@ function industrialtest.Machine.allowMetadataInventoryMove(self,pos,fromList,fro
return industrialtest.Machine.allowMetadataInventoryMove(self,pos,fromList,fromIndex,toList,toIndex,count)
end
function industrialtest.Machine.allowMetadataInventoryPut(self,pos,listname,index,stack,player)
function industrialtest.ElectricMachine.allowMetadataInventoryPut(self,pos,listname,index,stack,player)
local found=false
if self.powerLists then
for _,value in ipairs(self.powerLists) do