mirror of
https://github.com/mrSkortch/MissionScriptingTools.git
synced 2025-08-15 10:47:23 +00:00
Fix for checking CA slots
-Fixed bug due to mission file adding a string value into a table that is normally just a table of numbers. Added a type check to handle that.
This commit is contained in:
parent
0fb1bf157b
commit
d550180e58
4
mist.lua
4
mist.lua
@ -35,7 +35,7 @@ mist = {}
|
|||||||
-- don't change these
|
-- don't change these
|
||||||
mist.majorVersion = 4
|
mist.majorVersion = 4
|
||||||
mist.minorVersion = 4
|
mist.minorVersion = 4
|
||||||
mist.build = 90
|
mist.build = 91
|
||||||
|
|
||||||
-- forward declaration of log shorthand
|
-- forward declaration of log shorthand
|
||||||
local log
|
local log
|
||||||
@ -5288,7 +5288,7 @@ do -- mist.msg scope
|
|||||||
if type(value) == 'table' then
|
if type(value) == 'table' then
|
||||||
for roleName, roleVal in pairs(value) do
|
for roleName, roleVal in pairs(value) do
|
||||||
for rIndex, rVal in pairs(roleVal) do
|
for rIndex, rVal in pairs(roleVal) do
|
||||||
if env.mission.groundControl[index][roleName][rIndex] > 0 then
|
if type(rVal) == 'number' and rVal > 0 then
|
||||||
caSlots = true
|
caSlots = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|||||||
@ -35,7 +35,7 @@ mist = {}
|
|||||||
-- don't change these
|
-- don't change these
|
||||||
mist.majorVersion = 4
|
mist.majorVersion = 4
|
||||||
mist.minorVersion = 4
|
mist.minorVersion = 4
|
||||||
mist.build = 90
|
mist.build = 91
|
||||||
|
|
||||||
-- forward declaration of log shorthand
|
-- forward declaration of log shorthand
|
||||||
local log
|
local log
|
||||||
@ -5288,7 +5288,7 @@ do -- mist.msg scope
|
|||||||
if type(value) == 'table' then
|
if type(value) == 'table' then
|
||||||
for roleName, roleVal in pairs(value) do
|
for roleName, roleVal in pairs(value) do
|
||||||
for rIndex, rVal in pairs(roleVal) do
|
for rIndex, rVal in pairs(roleVal) do
|
||||||
if env.mission.groundControl[index][roleName][rIndex] > 0 then
|
if type(rVal) == 'number' and rVal > 0 then
|
||||||
caSlots = true
|
caSlots = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user