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 1

Also moving the ECM effect update code to a reasonable place - it has no business being in HeadUpDisplay.m.
  • Loading branch information
AnotherCommander authored Nov 26, 2024
1 parent 81cc49c commit 5688f90
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/Core/HeadUpDisplay.m
Original file line number Diff line number Diff line change
Expand Up @@ -1188,8 +1188,6 @@ - (void) drawScanner:(NSDictionary *)info
BOOL isHostile = NO;

BOOL inColorBlindMode = [UNIVERSE colorblindMode] != OO_POSTFX_NONE;

static BOOL gettingInterference = NO;

if (emptyDial)
{
Expand Down Expand Up @@ -1323,28 +1321,6 @@ - (void) drawScanner:(NSDictionary *)info

relativePosition = [PLAYER vectorTo:scannedEntity];
double fuzz = [PLAYER scannerFuzziness];
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 (fuzz > 0.0)
{
if (!gettingInterference)
{
[UNIVERSE setCurrentPostFX:OO_POSTFX_CRTBADSIGNAL];
gettingInterference = YES;
}
}
else
{
if (gettingInterference)
{
[UNIVERSE setCurrentPostFX:[UNIVERSE colorblindMode]];
gettingInterference = NO;
}
}
}

if (fuzz > 0 && ![[UNIVERSE gameController] isGamePaused])
{
relativePosition = vector_add(relativePosition,OOVectorRandomRadial(fuzz));
Expand Down Expand Up @@ -1499,11 +1475,6 @@ - (void) drawScanner:(NSDictionary *)info
}

}
else if ([UNIVERSE useShaders] && [UNIVERSE ECMVisualFXEnabled] && gettingInterference)
{
// no ECM interference fx if we are docking
[UNIVERSE setCurrentPostFX:[UNIVERSE colorblindMode]];
}

for (i = 0; i < ent_count; i++)
{
Expand Down

0 comments on commit 5688f90

Please sign in to comment.