diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 290444c0f..7dc47c709 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ 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 - Internal ship structures and queues refactoring and cleanup - Alex - Fix quitting out of IP before the IP is fully set (bug #987) - Michael diff --git a/sc2/src/sc2code/uqmdebug.c b/sc2/src/sc2code/uqmdebug.c index fa7d1dedc..0a3c823a4 100644 --- a/sc2/src/sc2code/uqmdebug.c +++ b/sc2/src/sc2code/uqmdebug.c @@ -365,8 +365,19 @@ void doInstantMove (void) { // Move to the new location: - GLOBAL_SIS (log_x) = UNIVERSE_TO_LOGX((GLOBAL (autopilot)).x); - GLOBAL_SIS (log_y) = UNIVERSE_TO_LOGY((GLOBAL (autopilot)).y); + 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_y) = UNIVERSE_TO_LOGY((GLOBAL (autopilot)).y); + } // Check for a solar systems at the destination. if (GET_GAME_STATE (ARILOU_SPACE_SIDE) <= 1)