Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions mist.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4457,13 +4457,14 @@ do -- group functions scope
newGroupData.units[unitNum].x = unitData.x + diff.x
newGroupData.units[unitNum].y = unitData.y + diff.y
end
if point then

-- Set the altitude if it isn't set already and we don't use the one from the cloned template.
if point and (not newGroupData.units[unitNum].alt or not vars.useTemplateAltitude) 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
newGroupData.units[unitNum].alt = point.y
--log:info('far enough from ground')
else

if newGroupData.category == 'plane' then
--log:info('setNewAlt')
newGroupData.units[unitNum].alt = land.getHeight({newGroupData.units[unitNum].x, newGroupData.units[unitNum].y}) + math.random(300, 9000)
Expand Down