Revert "Ported the COMPATF2_OLD_RANDOM_GENERATOR compatibility flag from Zandronum".

It made demos and MP games desync.
This commit is contained in:
drfrag 2020-08-24 16:19:16 +02:00
parent f9bd158211
commit e002d61823
2 changed files with 10 additions and 24 deletions

View file

@ -273,26 +273,6 @@ FRandom::~FRandom ()
}
}
// [BB] Moved implementation here.
int FRandom::operator()()
{
// [BB] Use Doom's original random numbers if the user wants it.
if ( compatflags2 & COMPATF2_OLD_RANDOM_GENERATOR )
return P_Random();
return GenRand32() & 255;
}
// [BB] Moved implementation here.
int FRandom::Random2()
{
// [BB] Use Doom's original random numbers if the user wants it.
if ( compatflags2 & COMPATF2_OLD_RANDOM_GENERATOR )
return ( P_Random() - P_Random() );
return Random2(255);
}
//==========================================================================
//
// FRandom :: StaticClearRandom

View file

@ -49,8 +49,10 @@ public:
~FRandom ();
// Returns a random number in the range [0,255]
// [BB] Moved the implementation to m_random.cpp.
int operator()();
int operator()()
{
return GenRand32() & 255;
}
// Returns a random number in the range [0,mod)
int operator() (int mod)
@ -61,8 +63,10 @@ public:
}
// Returns rand# - rand#
// [BB] Moved the implementation to m_random.cpp.
int Random2();
int Random2()
{
return Random2(255);
}
// Returns (rand# & mask) - (rand# & mask)
int Random2(int mask)
@ -224,4 +228,6 @@ extern FRandom M_Random;
int P_Random (void);
void M_ClearRandom (void);
extern int prndindex;
#endif