diff --git a/sc2/ChangeLog b/sc2/ChangeLog index b95df910b..f6d9b4f1a 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.7: +- Fixed AI ship not moving on warp in (bug #648) - Alex - Revert gfx settings entirely when a mode switch fails (bug #1056) - Alex - Fixed the Syreen lights-out scene timing (bug #1011) - Alex - Added a native error box for MacOSX (like we have for Windows) - Alex diff --git a/sc2/src/uqm/cyborg.c b/sc2/src/uqm/cyborg.c index f2e6c329d..f8fc5ba23 100644 --- a/sc2/src/uqm/cyborg.c +++ b/sc2/src/uqm/cyborg.c @@ -1124,13 +1124,14 @@ if (!(ShipPtr->state_flags & FINITE_LIFE) ed.facing = ARCTAN (-dx, -dy); if (UltraManeuverable) ed.MoveState = AVOID; - else + else // Try a gravity whip ed.MoveState = ENTICE; ObjectsOfConcern[GRAVITY_MASS_INDEX] = ed; } - else if (!UltraManeuverable) - { + else if (!UltraManeuverable && + !IsVelocityZero (&Ship.velocity)) + { // Try an orbital insertion, don't thrust ++Ship.thrust_wait; if (Ship.turn_wait) ShipMoved = TRUE; diff --git a/sc2/src/uqm/velocity.h b/sc2/src/uqm/velocity.h index 29d19cf6e..eb2585b17 100644 --- a/sc2/src/uqm/velocity.h +++ b/sc2/src/uqm/velocity.h @@ -45,6 +45,14 @@ extern void SetVelocityComponents (VELOCITY_DESC *velocityptr, SIZE dx, extern void DeltaVelocityComponents (VELOCITY_DESC *velocityptr, SIZE dx, SIZE dy); +static inline BOOLEAN +IsVelocityZero (VELOCITY_DESC *vptr) +{ + return vptr->vector.width == 0 && vptr->vector.height == 0 && + vptr->incr.width == 0 && vptr->incr.height == 0 && + vptr->fract.width == 0 && vptr->fract.height == 0; +} + static inline DWORD VelocitySquared (SIZE dx, SIZE dy) {