Boutros Tawaifi 43ba8b859e Measure afterburner cooldowns on the mission clock (#7895)
* Measure afterburner cooldowns on the mission clock

afterburners_start()/afterburners_stop() timed the +Aburn Cooldown Time delay and
the player's 1.3 s re-engage delay with timer_get_milliseconds(), the real
clock. Under time compression a cooldown therefore lasted longer in mission
time than the table says, and it kept running while the game was paused. The
cooldown was added in 2020 and reused the retail re-engage check's real-clock
"now"; the rest of the file (ABURN_DECAY_TIME, the sound timers) already uses
mission timestamps.

Both delays now use the mission clock. The mission clock does not run outside
missions, so it can still be near zero when the first mission of a session
starts; the "last stopped" and "last started" times therefore start out
invalid instead of 0, so that no delay is in effect before the afterburner has
been used.

Without time compression or pausing, the delays behave as before.

* Drop stale afterburner comment and use fl2i for the cooldown cast

The comment described an earlier startup state rather than the current
behavior. fl2i is the project's float-to-int macro and truncates the same
way the old C-style cast did.

* Remove the remaining afterburner cooldown comment

Timestamps running on mission time is the common case, so it doesn't
need a comment.
2026-11-02 22:39:31 -05:00
2019-02-26 19:53:11 +01:00
2025-06-11 22:21:51 +09:00
2019-11-15 23:33:35 -05:00
2018-04-21 23:01:19 +02:00
2019-12-01 09:58:53 -02:00
2019-12-01 09:58:53 -02:00
2020-10-29 21:24:42 -06:00
2016-07-22 12:07:19 +02:00
2003-03-02 04:53:46 +00:00
2023-08-09 15:08:36 -04:00
2020-10-29 21:24:42 -06:00

FreeSpace2 Source Code Project

Coverity

Building

Before you do anything, make sure you have updated your git submodules, either by running git submodule update --init --recursive or by cloning the repository with the --recursive flag.

The main instructions for building can be found at our github wiki, on the Building page.

S
Description
Origin Repository for SCP FreeSpace 2 Open
Readme
305 MiB
0 Stars 1 Watchers 0 Forks
2026-11-07 08:08:28 -10:00
Languages
C++ 75.7%
C 22%
CMake 1%
HTML 0.5%
Objective-C++ 0.3%
Other 0.2%