Fixed instant-move towards the current location.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2808 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
Meep-Eep
2007-07-13 16:34:35 +00:00
parent 1d6776ce8f
commit 9e60ced31a
2 changed files with 14 additions and 2 deletions
+1
View File
@@ -1,4 +1,5 @@
Changes towards version 0.7: Changes towards version 0.7:
- (debugging) Fixed instant-move towards the current location - SvdB
- Fixed wrong Sa-Matra guards icons after Kohr-Ah win (bug #1001) - Alex - Fixed wrong Sa-Matra guards icons after Kohr-Ah win (bug #1001) - Alex
- Internal ship structures and queues refactoring and cleanup - Alex - Internal ship structures and queues refactoring and cleanup - Alex
- Fix quitting out of IP before the IP is fully set (bug #987) - Michael - Fix quitting out of IP before the IP is fully set (bug #987) - Michael
+11
View File
@@ -365,8 +365,19 @@ void
doInstantMove (void) doInstantMove (void)
{ {
// Move to the new location: // Move to the new location:
if ((GLOBAL (autopilot)).x == ~0 || (GLOBAL (autopilot)).y == ~0)
{
// If no destination has been selected, use the current location
// as the destination.
(GLOBAL (autopilot)).x = LOGX_TO_UNIVERSE(GLOBAL_SIS (log_x));
(GLOBAL (autopilot)).y = LOGY_TO_UNIVERSE(GLOBAL_SIS (log_y));
}
else
{
// A new destination has been selected.
GLOBAL_SIS (log_x) = UNIVERSE_TO_LOGX((GLOBAL (autopilot)).x); GLOBAL_SIS (log_x) = UNIVERSE_TO_LOGX((GLOBAL (autopilot)).x);
GLOBAL_SIS (log_y) = UNIVERSE_TO_LOGY((GLOBAL (autopilot)).y); GLOBAL_SIS (log_y) = UNIVERSE_TO_LOGY((GLOBAL (autopilot)).y);
}
// Check for a solar systems at the destination. // Check for a solar systems at the destination.
if (GET_GAME_STATE (ARILOU_SPACE_SIDE) <= 1) if (GET_GAME_STATE (ARILOU_SPACE_SIDE) <= 1)