I was suffering something similar to that effect when I was working on my
extended bitvectoring, my hack to fix it was to return 1 less than the
intended number, but also to check if it it more than the max, and reset it
to 0. Here's a quick example:
...somefunction call...
...iteration loop (j)....
if(case you want){
j=j-1
return j
break
...loopagain...

...in function that called it...
tempvar=somefuction-1
if tempval>maxallowed
   tempvar=0

the reason for the overmax check is when it was supposed to return 0, it
returned a random, ungodly number (i went through GDB a hundred times, and
everytime it did the math as 1-1=XXXXX... (X's are random, and of varying
length), yet 2-1=1 it stumped me, so i came up with a solution, as it was
always over the max (supposed to return short, i also tried int, but it
returned a random long or double when it was supposed to return 0)

it's a horrible little hack that works (i poked at it for hours and hours
and couldn't get it to work how it looked like it was supposed to) hopefully
this makes it operate well enough for now, until one of us finds the true
problem (which i still am working on, yet not as hard, now that it is at
least working). for some of my settings (don't know it it applies to your
case) if a setting was not bool'd TRUE to be settable by any player, it
would not count it in the loop (might be my functions there, was working on
my olc: that i fixed by adding a check for that and increaseing the
iteration number regardless of the true/false if i can set it or not)

Good Luck
Drylar, Idiot Savant



Reply via email to