mirror of
https://github.com/mrSkortch/MissionScriptingTools.git
synced 2025-08-15 10:47:23 +00:00
Fixed teleportToPoint if radius was nil or 0
This commit is contained in:
parent
4cccfc6a03
commit
40a186c71d
12
mist.lua
12
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 = 82
|
mist.build = 83
|
||||||
|
|
||||||
-- forward declaration of log shorthand
|
-- forward declaration of log shorthand
|
||||||
local log
|
local log
|
||||||
@ -3211,7 +3211,7 @@ do -- group functions scope
|
|||||||
--log:info('get Randomized Point')
|
--log:info('get Randomized Point')
|
||||||
local diff = {x = 0, y = 0}
|
local diff = {x = 0, y = 0}
|
||||||
local newCoord, origCoord
|
local newCoord, origCoord
|
||||||
if point and radius > 0 then
|
if point and radius >= 0 then
|
||||||
local valid = false
|
local valid = false
|
||||||
|
|
||||||
local validTerrain
|
local validTerrain
|
||||||
@ -3243,7 +3243,7 @@ do -- group functions scope
|
|||||||
if not newGroupData.category and mist.DBs.groupsByName[newGroupData.groupName].category then
|
if not newGroupData.category and mist.DBs.groupsByName[newGroupData.groupName].category then
|
||||||
newGroupData.category = mist.DBs.groupsByName[newGroupData.groupName].category
|
newGroupData.category = mist.DBs.groupsByName[newGroupData.groupName].category
|
||||||
end
|
end
|
||||||
log:info(point)
|
--log:info(point)
|
||||||
for unitNum, unitData in pairs(newGroupData.units) do
|
for unitNum, unitData in pairs(newGroupData.units) do
|
||||||
if disperse then
|
if disperse then
|
||||||
if maxDisp and type(maxDisp) == 'number' and unitNum ~= 1 then
|
if maxDisp and type(maxDisp) == 'number' and unitNum ~= 1 then
|
||||||
@ -3262,11 +3262,11 @@ do -- group functions scope
|
|||||||
if (newGroupData.category == 'plane' or newGroupData.category == 'helicopter') then
|
if (newGroupData.category == 'plane' or newGroupData.category == 'helicopter') then
|
||||||
if point.z and point.y > 0 and point.y > land.getHeight({newGroupData.units[unitNum].x, newGroupData.units[unitNum].y}) + 10 then
|
if point.z and point.y > 0 and point.y > land.getHeight({newGroupData.units[unitNum].x, newGroupData.units[unitNum].y}) + 10 then
|
||||||
newGroupData.units[unitNum].alt = point.y
|
newGroupData.units[unitNum].alt = point.y
|
||||||
log:info('far enough from ground')
|
--log:info('far enough from ground')
|
||||||
else
|
else
|
||||||
|
|
||||||
if newGroupData.category == 'plane' then
|
if newGroupData.category == 'plane' then
|
||||||
log:info('setNewAlt')
|
--log:info('setNewAlt')
|
||||||
newGroupData.units[unitNum].alt = land.getHeight({newGroupData.units[unitNum].x, newGroupData.units[unitNum].y}) + math.random(300, 9000)
|
newGroupData.units[unitNum].alt = land.getHeight({newGroupData.units[unitNum].x, newGroupData.units[unitNum].y}) + math.random(300, 9000)
|
||||||
else
|
else
|
||||||
newGroupData.units[unitNum].alt = land.getHeight({newGroupData.units[unitNum].x, newGroupData.units[unitNum].y}) + math.random(200, 3000)
|
newGroupData.units[unitNum].alt = land.getHeight({newGroupData.units[unitNum].x, newGroupData.units[unitNum].y}) + math.random(200, 3000)
|
||||||
@ -3293,7 +3293,7 @@ do -- group functions scope
|
|||||||
if route then
|
if route then
|
||||||
newGroupData.route = route
|
newGroupData.route = route
|
||||||
end
|
end
|
||||||
log:info(newGroupData)
|
--log:info(newGroupData)
|
||||||
--mist.debug.writeData(mist.utils.serialize,{'teleportToPoint', newGroupData}, 'newGroupData.lua')
|
--mist.debug.writeData(mist.utils.serialize,{'teleportToPoint', newGroupData}, 'newGroupData.lua')
|
||||||
if string.lower(newGroupData.category) == 'static' then
|
if string.lower(newGroupData.category) == 'static' then
|
||||||
--log:info(newGroupData)
|
--log:info(newGroupData)
|
||||||
|
|||||||
@ -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 = 82
|
mist.build = 83
|
||||||
|
|
||||||
-- forward declaration of log shorthand
|
-- forward declaration of log shorthand
|
||||||
local log
|
local log
|
||||||
@ -3211,7 +3211,7 @@ do -- group functions scope
|
|||||||
--log:info('get Randomized Point')
|
--log:info('get Randomized Point')
|
||||||
local diff = {x = 0, y = 0}
|
local diff = {x = 0, y = 0}
|
||||||
local newCoord, origCoord
|
local newCoord, origCoord
|
||||||
if point and radius > 0 then
|
if point and radius >= 0 then
|
||||||
local valid = false
|
local valid = false
|
||||||
|
|
||||||
local validTerrain
|
local validTerrain
|
||||||
@ -3243,7 +3243,7 @@ do -- group functions scope
|
|||||||
if not newGroupData.category and mist.DBs.groupsByName[newGroupData.groupName].category then
|
if not newGroupData.category and mist.DBs.groupsByName[newGroupData.groupName].category then
|
||||||
newGroupData.category = mist.DBs.groupsByName[newGroupData.groupName].category
|
newGroupData.category = mist.DBs.groupsByName[newGroupData.groupName].category
|
||||||
end
|
end
|
||||||
log:info(point)
|
--log:info(point)
|
||||||
for unitNum, unitData in pairs(newGroupData.units) do
|
for unitNum, unitData in pairs(newGroupData.units) do
|
||||||
if disperse then
|
if disperse then
|
||||||
if maxDisp and type(maxDisp) == 'number' and unitNum ~= 1 then
|
if maxDisp and type(maxDisp) == 'number' and unitNum ~= 1 then
|
||||||
@ -3262,11 +3262,11 @@ do -- group functions scope
|
|||||||
if (newGroupData.category == 'plane' or newGroupData.category == 'helicopter') then
|
if (newGroupData.category == 'plane' or newGroupData.category == 'helicopter') then
|
||||||
if point.z and point.y > 0 and point.y > land.getHeight({newGroupData.units[unitNum].x, newGroupData.units[unitNum].y}) + 10 then
|
if point.z and point.y > 0 and point.y > land.getHeight({newGroupData.units[unitNum].x, newGroupData.units[unitNum].y}) + 10 then
|
||||||
newGroupData.units[unitNum].alt = point.y
|
newGroupData.units[unitNum].alt = point.y
|
||||||
log:info('far enough from ground')
|
--log:info('far enough from ground')
|
||||||
else
|
else
|
||||||
|
|
||||||
if newGroupData.category == 'plane' then
|
if newGroupData.category == 'plane' then
|
||||||
log:info('setNewAlt')
|
--log:info('setNewAlt')
|
||||||
newGroupData.units[unitNum].alt = land.getHeight({newGroupData.units[unitNum].x, newGroupData.units[unitNum].y}) + math.random(300, 9000)
|
newGroupData.units[unitNum].alt = land.getHeight({newGroupData.units[unitNum].x, newGroupData.units[unitNum].y}) + math.random(300, 9000)
|
||||||
else
|
else
|
||||||
newGroupData.units[unitNum].alt = land.getHeight({newGroupData.units[unitNum].x, newGroupData.units[unitNum].y}) + math.random(200, 3000)
|
newGroupData.units[unitNum].alt = land.getHeight({newGroupData.units[unitNum].x, newGroupData.units[unitNum].y}) + math.random(200, 3000)
|
||||||
@ -3293,7 +3293,7 @@ do -- group functions scope
|
|||||||
if route then
|
if route then
|
||||||
newGroupData.route = route
|
newGroupData.route = route
|
||||||
end
|
end
|
||||||
log:info(newGroupData)
|
--log:info(newGroupData)
|
||||||
--mist.debug.writeData(mist.utils.serialize,{'teleportToPoint', newGroupData}, 'newGroupData.lua')
|
--mist.debug.writeData(mist.utils.serialize,{'teleportToPoint', newGroupData}, 'newGroupData.lua')
|
||||||
if string.lower(newGroupData.category) == 'static' then
|
if string.lower(newGroupData.category) == 'static' then
|
||||||
--log:info(newGroupData)
|
--log:info(newGroupData)
|
||||||
Loading…
x
Reference in New Issue
Block a user