I still stand by what I said.... do this....
A single, integer comparison is going to be faster than the sample code. Four floating point comparisons (which as we've discussed are flakey) and the logic to combine their results. I'd go for the single integer comparison any day (in this instance).Code:If (lightsource[i].sourceType=GUNFIRE) then begin // Do something end;
Bookmarks