Minor bugfixes

This commit is contained in:
Pax1601 2023-03-26 18:04:17 +02:00
parent 658efe3daf
commit 911a81169b
5 changed files with 8 additions and 7 deletions

View File

@ -75,7 +75,7 @@ export class Slider {
{
this.#value = newValue;
if (this.#slider != null)
this.#slider.value = String((newValue - this.#minValue) / (this.#maxValue - this.#minValue) * 100);
this.#slider.value = String((newValue - this.#minValue) / (this.#maxValue - this.#minValue) * parseFloat(this.#slider.max));
this.#onValue()
}
}
@ -120,7 +120,7 @@ export class Slider {
this.#dragged = false;
if (this.#slider != null)
{
this.#value = this.#minValue + parseFloat(this.#slider.value) / 100 * (this.#maxValue - this.#minValue);
this.#value = this.#minValue + parseFloat(this.#slider.value) / parseFloat(this.#slider.max) * (this.#maxValue - this.#minValue);
this.#callback(this.getValue());
}
}

View File

@ -1,4 +1,4 @@
local version = 'v0.1.0-alpha'
local version = 'v0.1.1-alpha'
Olympus = {}
Olympus.OlympusDLL = nil

View File

@ -63,11 +63,13 @@ void Aircraft::changeAltitude(wstring change)
void Aircraft::setTargetSpeed(double newTargetSpeed) {
targetSpeed = newTargetSpeed;
addMeasure(L"targetSpeed", json::value(targetSpeed));
goToDestination();
if (activeDestination != NULL)
goToDestination();
}
void Aircraft::setTargetAltitude(double newTargetAltitude) {
targetAltitude = newTargetAltitude;
addMeasure(L"targetAltitude", json::value(targetAltitude));
goToDestination();
if (activeDestination != NULL)
goToDestination();
}

View File

@ -149,7 +149,7 @@ bool AirUnit::updateActivePath(bool looping)
/* Push the next destination in the queue to the front */
if (looping)
pushActivePathBack(activePath.front());
activePath.pop_front();
popActivePathFront();
log(unitName + L" active path front popped");
return true;
}

View File

@ -201,7 +201,6 @@ void Unit::popActivePathFront()
setActivePath(path);
}
void Unit::setCoalitionID(int newCoalitionID)
{
if (newCoalitionID == 0)