13 Mar 11, 01:23PM
ac_bot.cpp, line 27 goes like
However, this used to be rnd(4) in 1.0 and it seemed to work fine, didn't it?
Then looking at the rnd function (ln 61, tools.cpp):
Then looking at randomMT
The problem is, tools.h was changed, specifically the part with random numbers. eihrul changed the function, but I can't tell what it does exactly I'm uber C++ noob. Then, thinking that rnd(6) would now be required for weapon numbers 2 3 4 5 6 7, I did that and compiled an SVN client with the change.
I found bots with ARs.
I also found bots with no weapon.
????
save us, eihrul!
[SELECT ALL] Code:
m_pMyEnt->nextprimary = 2 + rnd(5); // 2011jan18:ft: 2 == GUN_RIFLE, GUN_SHOTGUN, GUN_SUBGUN, GUN_SNIPER, GUN_ASSAULT - if CPISTOL is activated this needs a FIXME to rnd(6)
However, this used to be rnd(4) in 1.0 and it seemed to work fine, didn't it?
Then looking at the rnd function (ln 61, tools.cpp):
[SELECT ALL] Code:
#define rnd(x) ((int)(randomMT()&0xFFFFFF)%(x))
Then looking at randomMT
[SELECT ALL] Code:
uint randomMT(void)
{
uint y;
if(--left < 0) return(reloadMT());
y = *next++;
y ^= (y >> 11);
y ^= (y << 7) & 0x9D2C5680U;
y ^= (y << 15) & 0xEFC60000U;
return(y ^ (y >> 18));
}
The problem is, tools.h was changed, specifically the part with random numbers. eihrul changed the function, but I can't tell what it does exactly I'm uber C++ noob. Then, thinking that rnd(6) would now be required for weapon numbers 2 3 4 5 6 7, I did that and compiled an SVN client with the change.
I found bots with ARs.
I also found bots with no weapon.
????
save us, eihrul!