Skip to content

Commit

Permalink
- moved rnd_plasma into global space again.
Browse files Browse the repository at this point in the history
C++'s init rules for local static variables are so dumb that this will cause undefined behavior with the RNG management, it's also very inefficient.
  • Loading branch information
coelckers committed Aug 3, 2023
1 parent 7936aca commit 20b9650
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/games/exhumed/src/2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ void DrawLogo()
//
//
//---------------------------------------------------------------------------
static FRandom rnd_plasma;

void menu_DoPlasma()
{
Expand All @@ -101,7 +102,6 @@ void menu_DoPlasma()
static int plasma_A[5];
static int plasma_B[5];
static int plasma_C[5];
static FRandom rnd_plasma;

if (!nPlasmaTile)
{
Expand Down

0 comments on commit 20b9650

Please sign in to comment.