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:
mrSkortch 2020-09-30 15:33:47 -06:00
parent 0fb1bf157b
commit d550180e58
2 changed files with 18 additions and 18 deletions

View File

@ -35,7 +35,7 @@ mist = {}
-- don't change these
mist.majorVersion = 4
mist.minorVersion = 4
mist.build = 90
mist.build = 91
-- forward declaration of log shorthand
local log
@ -5288,7 +5288,7 @@ do -- mist.msg scope
if type(value) == 'table' then
for roleName, roleVal in pairs(value) 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
break
end

View File

@ -35,7 +35,7 @@ mist = {}
-- don't change these
mist.majorVersion = 4
mist.minorVersion = 4
mist.build = 90
mist.build = 91
-- forward declaration of log shorthand
local log
@ -5288,7 +5288,7 @@ do -- mist.msg scope
if type(value) == 'table' then
for roleName, roleVal in pairs(value) 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
break
end