Fixed error in Olympus Command

And added some minor optimization
This commit is contained in:
Pax1601
2023-03-22 17:50:45 +01:00
parent 01852518b7
commit c8d809c3e7
2 changed files with 6 additions and 5 deletions

View File

@@ -116,9 +116,10 @@ export class Unit extends Marker {
setData(data: UpdateData) { setData(data: UpdateData) {
document.dispatchEvent(new CustomEvent("unitUpdated", { detail: this })); document.dispatchEvent(new CustomEvent("unitUpdated", { detail: this }));
var updateMarker = false; var updateMarker = false;
if (this.getFlightData().latitude != data.flightData.latitude ||
this.getFlightData().longitude != data.flightData.longitude || if ((data.flightData.latitude != undefined && data.flightData.longitude != undefined && (this.getFlightData().latitude != data.flightData.latitude || this.getFlightData().longitude != data.flightData.longitude))
this.getBaseData().alive != data.baseData.alive || this.#forceUpdate || !getMap().hasLayer(this)) || (data.baseData.alive != undefined && this.getBaseData().alive != data.baseData.alive)
|| this.#forceUpdate || !getMap().hasLayer(this))
updateMarker = true; updateMarker = true;
if (data.baseData != undefined) if (data.baseData != undefined)

View File

@@ -12,7 +12,7 @@ Olympus.DLLsloaded = false
Olympus.OlympusModPath = os.getenv('DCSOLYMPUS_PATH')..'\\bin\\' Olympus.OlympusModPath = os.getenv('DCSOLYMPUS_PATH')..'\\bin\\'
function Olympus.debug(message, displayFor) function Olympus.debug(message, displayFor)
if debug then: if debug == true then
trigger.action.outText(message, displayFor) trigger.action.outText(message, displayFor)
end end
end end