Skip to content

Commit

Permalink
Fixing bug where ECM effect does not work when no entities are on sca…
Browse files Browse the repository at this point in the history
…nner - act 2
  • Loading branch information
AnotherCommander authored Nov 26, 2024
1 parent 5688f90 commit c33ed9f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Core/Entities/PlayerEntity.m
Original file line number Diff line number Diff line change
Expand Up @@ -2725,6 +2725,8 @@ - (void) doBookkeeping:(double) delta_t
STAGE_TRACKING_BEGIN

double speed_delta = SHIP_THRUST_FACTOR * thrust;

static BOOL gettingInterference = NO;

OOSunEntity *sun = [UNIVERSE sun];
double external_temp = 0;
Expand Down Expand Up @@ -2819,6 +2821,29 @@ - (void) doBookkeeping:(double) delta_t
ecm_in_operation = NO;
}
}

// ecm interference visual effect
if ([UNIVERSE useShaders] && [UNIVERSE ECMVisualFXEnabled])
{
// we want to start and stop the effect exactly once, not start it
// or stop it on every frame
if ([self scannerFuzziness] > 0.0)
{
if (!gettingInterference)
{
[UNIVERSE setCurrentPostFX:OO_POSTFX_CRTBADSIGNAL];
gettingInterference = YES;
}
}
else
{
if (gettingInterference)
{
[UNIVERSE setCurrentPostFX:[UNIVERSE colorblindMode]];
gettingInterference = NO;
}
}
}

// Energy Banks and Shields

Expand Down

0 comments on commit c33ed9f

Please sign in to comment.