use get/set for parameters on ports and wires
This commit is contained in:
@@ -62,10 +62,10 @@ function GateDefinition.constructgate(self, objref, position, rotation)
|
||||
local gate = Gate.new(Gate, objref, self)
|
||||
|
||||
for i = 1, #self.ports do
|
||||
local port = self.ports[i]
|
||||
local type = port.type
|
||||
local pos = {port.position[1], port.position[2], port.position[3]}
|
||||
local dir = port.direction
|
||||
local portd = self.ports[i]
|
||||
local type = portd.type
|
||||
local pos = {portd.position[1], portd.position[2], portd.position[3]}
|
||||
local dir = portd.direction
|
||||
|
||||
if dir < 4 then
|
||||
dir = (dir + rotation) % 4
|
||||
@@ -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]}, port.causeupdate))
|
||||
Gate.addport(gate, Port.new(Port, type, dir, {position[1]+pos[1], position[2]+pos[2], position[3]+pos[3]}, portd.causeupdate))
|
||||
end
|
||||
|
||||
return gate
|
||||
|
||||
Reference in New Issue
Block a user