- ideltax = ibq.x - game.state.kscmdr.x
- ideltay = ibq.y - game.state.kscmdr.y
- # Maximum movement is 1 quadrant in either or both axis
- if ideltax > 1:
- ideltax = 1
- if ideltax < -1:
- ideltax = -1
- if ideltay > 1:
- ideltay = 1
- if ideltay < -1:
- ideltay = -1
-
- # try moving in both x and y directions
- iq.x = game.state.kscmdr.x + ideltax
- iq.y = game.state.kscmdr.y + ideltax
+ idelta = ibq - game.state.kscmdr
+ # Maximum movement is 1 quadrant in either or both axes
+ idelta = idelta.sgn()
+ # try moving in both x and y directions
+ # there was what looked like a bug in the Almy C code here,
+ # but it might be this translation is just wrong.
+ iq = game.state.kscmdr + idelta