From 31710b4e285e45f3885797c225030acd308efc41 Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Mon, 30 Oct 2023 09:56:07 +0100 Subject: [PATCH] Updated legal text --- client/src/constants/constants.ts | 2 +- client/src/controls/unitspawnmenu.ts | 13 ++++++------ client/views/other/dialogs.ejs | 31 ++++++++++++++++++++++++++-- src/core/src/groundunit.cpp | 8 +++---- 4 files changed, 41 insertions(+), 13 deletions(-) diff --git a/client/src/constants/constants.ts b/client/src/constants/constants.ts index 3c633a25..e0547d43 100644 --- a/client/src/constants/constants.ts +++ b/client/src/constants/constants.ts @@ -211,5 +211,5 @@ export const MGRS_PRECISION_100M = 4; export const MGRS_PRECISION_10M = 5; export const MGRS_PRECISION_1M = 6; -export const DELETE_CYCLE_TIME = 0.1; +export const DELETE_CYCLE_TIME = 0.05; export const DELETE_SLOW_THRESHOLD = 50; \ No newline at end of file diff --git a/client/src/controls/unitspawnmenu.ts b/client/src/controls/unitspawnmenu.ts index d23cf82a..0ed023d1 100644 --- a/client/src/controls/unitspawnmenu.ts +++ b/client/src/controls/unitspawnmenu.ts @@ -13,11 +13,8 @@ import { navyUnitDatabase } from "../unit/databases/navyunitdatabase"; import { UnitSpawnOptions, UnitSpawnTable } from "../interfaces"; export class UnitSpawnMenu { - #container: HTMLElement; - #unitDatabase: UnitDatabase; - #countryCodes: any; - #orderByRole: boolean; - spawnOptions: UnitSpawnOptions = { + protected showRangeCircles: boolean = false; + protected spawnOptions: UnitSpawnOptions = { roleType: "", name: "", latlng: new LatLng(0, 0), @@ -30,6 +27,11 @@ export class UnitSpawnMenu { altitude: undefined }; + #container: HTMLElement; + #unitDatabase: UnitDatabase; + #countryCodes: any; + #orderByRole: boolean; + /* Controls */ #unitRoleTypeDropdown: Dropdown; #unitLabelDropdown: Dropdown; @@ -50,7 +52,6 @@ export class UnitSpawnMenu { /* Range circle previews */ #engagementCircle: Circle; #acquisitionCircle: Circle; - protected showRangeCircles: boolean = false; constructor(ID: string, unitDatabase: UnitDatabase, orderByRole: boolean) { this.#container = document.getElementById(ID) as HTMLElement; diff --git a/client/views/other/dialogs.ejs b/client/views/other/dialogs.ejs index 55cee3f6..14296f1c 100644 --- a/client/views/other/dialogs.ejs +++ b/client/views/other/dialogs.ejs @@ -16,8 +16,35 @@ diff --git a/src/core/src/groundunit.cpp b/src/core/src/groundunit.cpp index 4220129a..801000b0 100644 --- a/src/core/src/groundunit.cpp +++ b/src/core/src/groundunit.cpp @@ -202,7 +202,7 @@ void GroundUnit::AIloop() double lat = 0; double lng = 0; - double randomBearing = bearing1 + (((double)(rand()) / (double)(RAND_MAX) - 0.5) * 2) * 15; + double randomBearing = bearing1 + (((double)(rand()) / (double)(RAND_MAX) - 0.5) * 2) * 0; // TODO put defined constant here Geodesic::WGS84().Direct(position.lat, position.lng, randomBearing, r, lat, lng); std::ostringstream taskSS; @@ -214,7 +214,7 @@ void GroundUnit::AIloop() } if (internalCounter == 0) - internalCounter = 20 / 0.05; + internalCounter = 20 / 0.05; // TODO make defined constant internalCounter--; break; @@ -285,7 +285,7 @@ void GroundUnit::AIloop() if (muzzleVelocity != 0) aimTime += distance / muzzleVelocity; - internalCounter = (aimTime + 2) / 0.05; + internalCounter = (aimTime + 2) / 0.05; // TODO fix me you fucking monster /* Compute where the target will be in aimTime seconds. We don't consider vertical velocity atm, since after all we are not really tring to hit */ double aimDistance = target->getSpeed() * aimTime; @@ -293,7 +293,7 @@ void GroundUnit::AIloop() double aimLng = 0; Geodesic::WGS84().Direct(target->getPosition().lat, target->getPosition().lng, target->getHeading() * 57.29577, aimDistance, aimLat, aimLng); /* TODO make util function */ - /* Compute distance to the aim point */ + /* Compute distance to the aim point */ // TODO: why am I here? double dist; double bearing1; double bearing2;