mirror of
https://github.com/mrSkortch/MissionScriptingTools.git
synced 2025-08-15 10:47:23 +00:00
Fix for dynAddStatic
Fixed minor bug with dynAddStatic where it would always assign a generated name if the entry lacked the alternate name entry of unitName.
This commit is contained in:
parent
f15b4428d0
commit
f029de164b
6
mist.lua
6
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 = 85
|
mist.build = 86
|
||||||
|
|
||||||
-- forward declaration of log shorthand
|
-- forward declaration of log shorthand
|
||||||
local log
|
local log
|
||||||
@ -1272,7 +1272,9 @@ do -- the main scope
|
|||||||
newObj.unitId = mistUnitId
|
newObj.unitId = mistUnitId
|
||||||
end
|
end
|
||||||
|
|
||||||
newObj.name = newObj.unitName
|
|
||||||
|
newObj.name = newObj.name or newObj.unitName
|
||||||
|
|
||||||
if newObj.clone or not newObj.name then
|
if newObj.clone or not newObj.name then
|
||||||
mistDynAddIndex[' static '] = mistDynAddIndex[' static '] + 1
|
mistDynAddIndex[' static '] = mistDynAddIndex[' static '] + 1
|
||||||
newObj.name = (newCountry .. ' static ' .. mistDynAddIndex[' static '])
|
newObj.name = (newCountry .. ' static ' .. mistDynAddIndex[' static '])
|
||||||
|
|||||||
@ -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 = 85
|
mist.build = 86
|
||||||
|
|
||||||
-- forward declaration of log shorthand
|
-- forward declaration of log shorthand
|
||||||
local log
|
local log
|
||||||
@ -1272,7 +1272,9 @@ do -- the main scope
|
|||||||
newObj.unitId = mistUnitId
|
newObj.unitId = mistUnitId
|
||||||
end
|
end
|
||||||
|
|
||||||
newObj.name = newObj.unitName
|
|
||||||
|
newObj.name = newObj.name or newObj.unitName
|
||||||
|
|
||||||
if newObj.clone or not newObj.name then
|
if newObj.clone or not newObj.name then
|
||||||
mistDynAddIndex[' static '] = mistDynAddIndex[' static '] + 1
|
mistDynAddIndex[' static '] = mistDynAddIndex[' static '] + 1
|
||||||
newObj.name = (newCountry .. ' static ' .. mistDynAddIndex[' static '])
|
newObj.name = (newCountry .. ' static ' .. mistDynAddIndex[' static '])
|
||||||
@ -6935,7 +6937,7 @@ do -- group tasks scope
|
|||||||
elseif type(terrainTypes) == 'table' then -- if its a table it does this check
|
elseif type(terrainTypes) == 'table' then -- if its a table it does this check
|
||||||
for typeId, typeData in pairs(terrainTypes) do
|
for typeId, typeData in pairs(terrainTypes) do
|
||||||
for constId, constData in pairs(land.SurfaceType) do
|
for constId, constData in pairs(land.SurfaceType) do
|
||||||
if string.lower(constId) == string.lower(typeData) or string.lower(constData) == string.lower(typeId) then
|
if string.lower(constId) == string.lower(typeData) or string.lower(constData) == string.lower(typeData) then
|
||||||
table.insert(typeConverted, constId)
|
table.insert(typeConverted, constId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user