fixed some misuse of ipairs over pairs
This commit is contained in:
8
main.lua
8
main.lua
@@ -179,9 +179,9 @@ function ThrottleInit()
|
|||||||
while true do
|
while true do
|
||||||
local currentStates = getRelayStates()
|
local currentStates = getRelayStates()
|
||||||
|
|
||||||
for pname, currentState in ipairs(currentStates) do
|
for pname, currentState in pairs(currentStates) do
|
||||||
local initialState = initialStates[pname]
|
local initialState = initialStates[pname]
|
||||||
for k, v in ipairs(currentState) do
|
for k, v in pairs(currentState) do
|
||||||
if initialState[k] ~= v then
|
if initialState[k] ~= v then
|
||||||
Throttles[throttleType].name = pname
|
Throttles[throttleType].name = pname
|
||||||
Throttles[throttleType].side = k
|
Throttles[throttleType].side = k
|
||||||
@@ -545,8 +545,8 @@ function UpdateGlobalThrust()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, d in ipairs(thrustDirections) do
|
for _, d in pairs(thrustDirections) do
|
||||||
for _, t in ipairs(Thrusters) do
|
for _, t in pairs(Thrusters) do
|
||||||
if t.affectVectors.lateral == d then
|
if t.affectVectors.lateral == d then
|
||||||
SetThrusterPower(t, d)
|
SetThrusterPower(t, d)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user