Multiple minor fixes

This commit is contained in:
Pax1601
2023-03-14 22:25:00 +01:00
parent 16b5e89a3e
commit 9ed4189c28
20 changed files with 91 additions and 75 deletions

View File

@@ -383,7 +383,7 @@ export class Unit extends Marker {
unitAltitudeDiv.innerHTML = String(Math.floor(this.getFlightData().altitude / 0.3048 / 1000));
}
var pos = getMap().latLngToLayerPoint(this.getLatLng()).round();
this.setZIndexOffset(Math.floor(this.getFlightData().altitude) - pos.y);
this.setZIndexOffset(1000 + Math.floor(this.getFlightData().altitude) - pos.y);
}
this.#forceUpdate = false;
@@ -503,7 +503,10 @@ export class Helicopter extends AirUnit {
export class GroundUnit extends Unit {
constructor(ID: number, data: UnitData) {
// TODO this is very messy
var role = groundUnitsDatabase.getByName(data.baseData.name)?.loadouts[0].roles[0];
if (role == undefined)
role = "U";
var roleType = (role === "SAM") ? "sam" : "mi";
super(ID, data, `

View File

@@ -101,6 +101,6 @@ export class UnitDatabase {
getShortLabelByName(name: string)
{
return this.units[name] === undefined? name: this.units[name].shortLabel;
return this.units[name] === undefined? "U": this.units[name].shortLabel;
}
}