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,11 +116,12 @@ export class Unit extends Marker {
setData(data: UpdateData) {
document.dispatchEvent(new CustomEvent("unitUpdated", { detail: this }));
var updateMarker = false;
if (this.getFlightData().latitude != data.flightData.latitude ||
this.getFlightData().longitude != data.flightData.longitude ||
this.getBaseData().alive != data.baseData.alive || this.#forceUpdate || !getMap().hasLayer(this))
if ((data.flightData.latitude != undefined && data.flightData.longitude != undefined && (this.getFlightData().latitude != data.flightData.latitude || this.getFlightData().longitude != data.flightData.longitude))
|| (data.baseData.alive != undefined && this.getBaseData().alive != data.baseData.alive)
|| this.#forceUpdate || !getMap().hasLayer(this))
updateMarker = true;
if (data.baseData != undefined)
{
for (let key in this.#data.baseData)

View File

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