feat: added airborne variable

This commit is contained in:
Pax1601
2025-03-31 08:14:17 +02:00
parent 825d60e754
commit 1248ffb60b
9 changed files with 26 additions and 4 deletions

View File

@@ -1236,6 +1236,7 @@ function Olympus.setUnitsData(arg, time)
local position = unit:getPosition()
local heading = math.atan2( position.x.z, position.x.x )
local velocity = unit:getVelocity();
local airborne = unit:inAir()
-- Fill the data table
table["name"] = unit:getTypeName()
@@ -1248,6 +1249,7 @@ function Olympus.setUnitsData(arg, time)
table["horizontalVelocity"] = math.sqrt(velocity.x * velocity.x + velocity.z * velocity.z)
table["verticalVelocity"] = velocity.y
table["heading"] = heading
table["airborne"] = airborne
-- Track angles are wrong because of weird reference systems, approximate it using latitude and longitude differences
if (table["horizontalVelocity"] > 1) then