make simulation non-global

This commit is contained in:
Redo0
2021-05-23 15:36:40 -05:00
parent 6c997a36fa
commit 569e79ab96
8 changed files with 52 additions and 54 deletions

View File

@@ -58,8 +58,8 @@ function GateDefinition.new(self, objref, name, description, init, logic, input,
return o
end
function GateDefinition.constructgate(self, objref, position, rotation)
local gate = Gate.new(Gate, objref, self)
function GateDefinition.constructgate(self, objref, position, rotation, sim)
local gate = Gate.new(Gate, objref, self, sim)
for i = 1, #self.ports do
local portd = self.ports[i]
@@ -84,7 +84,7 @@ function GateDefinition.constructgate(self, objref, position, rotation)
pos[2] = x
end
Gate.addport(gate, Port.new(Port, type, dir, {position[1]+pos[1], position[2]+pos[2], position[3]+pos[3]}, portd.causeupdate))
Gate.addport(gate, Port.new(Port, type, dir, {position[1]+pos[1], position[2]+pos[2], position[3]+pos[3]}, portd.causeupdate, gate.sim))
end
return gate