diff --git a/scripts/OlympusCommand.lua b/scripts/OlympusCommand.lua index 1ac8e583..50a0b539 100644 --- a/scripts/OlympusCommand.lua +++ b/scripts/OlympusCommand.lua @@ -1053,9 +1053,7 @@ function Olympus.setUnitsData(arg, time) table["isHuman"] = (unit:getPlayerName() ~= nil) table["hasTask"] = controller:hasTask() table["ammo"] = unit:getAmmo() --TODO remove a lot of stuff we don't really need - table["ammo"] = unit:getAmmo() --TODO: remove a lot of stuff we don't really need table["fuel"] = unit:getFuel() - table["health"] = unit:getLife() / unit:getLife0() * 100 table["health"] = unit:getLife() / initialLife * 100 table["contacts"] = contacts diff --git a/src/core/src/groundunit.cpp b/src/core/src/groundunit.cpp index b9ab0183..72a5078e 100644 --- a/src/core/src/groundunit.cpp +++ b/src/core/src/groundunit.cpp @@ -273,7 +273,8 @@ void GroundUnit::AIloop() case State::SCENIC_AAA: { setTask("Scenic AAA"); - if ((!getHasTask() || internalCounter == 0)) { + /* Only perform scenic functions when the scheduler is "free" */ + if (((!getHasTask() && scheduler->getLoad() == 0) || internalCounter == 0)) { double distance = 0; unsigned char unitCoalition = coalition == 0 ? getOperateAs() : coalition; unsigned char targetCoalition = unitCoalition == 2 ? 1 : 2; @@ -315,7 +316,8 @@ void GroundUnit::AIloop() canAAA = databaseEntry[L"canAAA"].as_bool(); } - if (canAAA) { + /* Only perform scenic functions when the scheduler is "free" */ + if (scheduler->getLoad() == 0 && canAAA) { /* Only run this when the internal counter reaches 0 to avoid excessive computations when no nearby target */ if (internalCounter == 0) { double distance = 0;