Skip to content

Commit

Permalink
Fix unchecked thruster level (#513)
Browse files Browse the repository at this point in the history
* Fix unchecked thruster level

* [D3D9]Fix missing include

* [Lua]Add XRSound assets dependency
  • Loading branch information
TheGondos authored Nov 21, 2024
1 parent 283479a commit 792aa78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions Src/Orbiter/Vessel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8297,6 +8297,7 @@ void VESSEL::IncThrusterLevel (THRUSTER_HANDLE th, double dlevel) const
if (vessel->bFRplayback) return;
ThrustSpec *ts = (ThrustSpec*)th;
ts->level_permanent += dlevel;
ts->level_permanent = max (0.0, min (1.0, ts->level_permanent));
if (ts->tank && ts->tank->mass)
ts->level = max (0.0, min (1.0, ts->level_permanent + ts->level_override));
}
Expand Down
1 change: 1 addition & 0 deletions Src/Orbiter/Vessel.h
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ class Vessel: public VesselBase {
{
if (!bFRplayback) {
ts->level_permanent += dlevel;
ts->level_permanent = std::max(0.0, std::min(1.0, ts->level_permanent));
if (ts->tank && ts->tank->mass)
ts->level = std::max(0.0, std::min(1.0, ts->level+dlevel));
}
Expand Down

0 comments on commit 792aa78

Please sign in to comment.