Do not try an orbital insertion when the ship is not moving; bug #648

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3259 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2009-10-28 05:00:07 +00:00
parent c5ef5f4bad
commit d8daf03969
3 changed files with 13 additions and 3 deletions
+1
View File
@@ -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
+4 -3
View File
@@ -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;
+8
View File
@@ -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)
{