mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed: MattKing's change to RANDOM to fix issue where it was only random once.
This commit is contained in:
parent
ed07f986fc
commit
2dbf79c6e6
@ -25,6 +25,7 @@
|
||||
using namespace std;
|
||||
|
||||
hqStrMap* CMeasureCalc::c_VarMap = NULL;
|
||||
bool CMeasureCalc::c_RandSeeded = false;
|
||||
|
||||
/*
|
||||
** CMeasureCalc
|
||||
@ -34,10 +35,15 @@ hqStrMap* CMeasureCalc::c_VarMap = NULL;
|
||||
*/
|
||||
CMeasureCalc::CMeasureCalc(CMeterWindow* meterWindow) : CMeasure(meterWindow)
|
||||
{
|
||||
m_Parser = MathParser_Create(NULL);
|
||||
if(!c_RandSeeded)
|
||||
{
|
||||
c_RandSeeded = true;
|
||||
srand((unsigned)time(0));
|
||||
rand();
|
||||
}
|
||||
|
||||
m_Parser = MathParser_Create(NULL);
|
||||
|
||||
rand();
|
||||
}
|
||||
|
||||
/*
|
||||
@ -147,6 +153,7 @@ void CMeasureCalc::RandomFormulaReplace()
|
||||
while(loc > -1)
|
||||
{
|
||||
int range = (m_HighBound - m_LowBound);
|
||||
srand((unsigned) rand());
|
||||
int randNumber = m_LowBound + (range * rand()/(RAND_MAX + 1.0));
|
||||
|
||||
std::wstring randomNumberString= (L"");
|
||||
|
@ -40,6 +40,7 @@ private:
|
||||
hqMathParser* m_Parser;
|
||||
|
||||
static hqStrMap* c_VarMap;
|
||||
static bool c_RandSeeded;
|
||||
|
||||
int m_UpdateRandom;
|
||||
int m_LowBound;
|
||||
|
Loading…
x
Reference in New Issue
Block a user