krzys_h

CBot rounding bug

Jan 30th, 2015
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.20 KB | None | 0 0
  1. extern void object::Test()
  2. {
  3.     for(int i=0; i<4; i++) {
  4.         float r = ((this.orientation-90)/90)%4;
  5.         if(r<0) r=4+r;
  6.         int r2 = r;
  7.         message(this.orientation+" -> "+r+" -> "+r2);
  8.         turn(90);
  9.     }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment