Skip to content

Commit

Permalink
Merge pull request #6464 from Goober5000/fix_engine_wash
Browse files Browse the repository at this point in the history
fix engine wash
  • Loading branch information
Goober5000 authored Dec 17, 2024
2 parents f4bd6aa + dfbf4da commit 9b1d425
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions code/ai/aiturret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2788,7 +2788,7 @@ void ai_turret_execute_behavior(const ship *shipp, ship_subsys *ss)
{
//something did fire, get the lowest valid timestamp
// don't do this if we already set a turret timestamp previously in the function
if (timestamp_since(ss->turret_next_fire_stamp) > 0)
if (timestamp_since(ss->turret_next_fire_stamp) >= 0)
{
int minimum_stamp = -1;

Expand All @@ -2797,7 +2797,7 @@ void ai_turret_execute_behavior(const ship *shipp, ship_subsys *ss)
int stamp = (i < MAX_SHIP_PRIMARY_BANKS) ? swp->next_primary_fire_stamp[i] : swp->next_secondary_fire_stamp[i - MAX_SHIP_PRIMARY_BANKS];

// valid timestamps start at 2; stamp must be in the future
if (stamp < 2 || timestamp_since(stamp) > 0)
if (stamp < 2 || timestamp_since(stamp) >= 0)
continue;

// find minimum
Expand Down
2 changes: 1 addition & 1 deletion code/ship/shipfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2685,7 +2685,7 @@ void engine_wash_ship_process(ship *shipp)

// is it time to check for engine wash
int time_to_next_hit = timestamp_until(shipp->wash_timestamp);
if (time_to_next_hit < 0) {
if (time_to_next_hit <= 0) {
if (time_to_next_hit < -ENGINE_WASH_CHECK_INTERVAL) {
time_to_next_hit = 0;
}
Expand Down

0 comments on commit 9b1d425

Please sign in to comment.