Quote:
Originally posted by Kaimetsu
dir+=2;
if(dir>3) dir-=4;
|
But aren't the npc attributes limited to a certain range? Then the dir wouldn't be able to get above 3. (I know, that would be no problem, you'd just use another variable).
And in some cases I'd use while(ndir > 3) instead of if(ndir > 3), just in case it is too big (Which is impossible at the given example).
But why is % slower? I think I've heard that modulo is quite a complex floating point operation, but we normaly have FPUs integrated in the CPUs and the FPU operation would still be faster than interpreting 3 additional Graal Script Commands, wouldn't it?