01 May 12, 09:02PM
Not quite; it's dynamic, depending on the amount of time you've been scoped.
It's not linear, but if you 'wait' 90ms, your spread is halved. If you 'wait' 150ms it's 1/6 the unscoped spread, and if you 'wait' 177ms there's no spread. Obviously, waiting a specific number of milliseconds is tricky. I think my maths is right; please correct me if necessary.
[SELECT ALL] Code:
#define SCOPESETTLETIME 180
int sniperrifle::dynspread()
{
if(scoped)
{
int scopetime = lastmillis - scoped_since;
if(scopetime > SCOPESETTLETIME)
return 1;
else
return max((info.spread * (SCOPESETTLETIME - scopetime)) / SCOPESETTLETIME, 1);
}
return info.spread;
}