diff --git a/sc2/src/sc2code/uqmdebug.c b/sc2/src/sc2code/uqmdebug.c index 55e63bd0e..e06014268 100644 --- a/sc2/src/sc2code/uqmdebug.c +++ b/sc2/src/sc2code/uqmdebug.c @@ -65,10 +65,11 @@ debugKeyPressed (void) equipShip (); instantMove = !instantMove; showSpheres (); + activateAllShips (); // forwardToNextEvent (TRUE); // Tests - //Scale_PerfTest (); +// Scale_PerfTest (); // Informational: // dumpEvents (stderr); @@ -353,6 +354,33 @@ showSpheres (void) //////////////////////////////////////////////////////////////////////////// +void +activateAllShips (void) +{ + HSTARSHIP hStarShip, hNextShip; + + for (hStarShip = GetHeadLink (&GLOBAL (avail_race_q)); + hStarShip != NULL; hStarShip = hNextShip) + { + EXTENDED_SHIP_FRAGMENTPTR StarShipPtr; + + StarShipPtr = (EXTENDED_SHIP_FRAGMENTPTR) LockStarShip ( + &GLOBAL (avail_race_q), hStarShip); + hNextShip = _GetSuccLink (StarShipPtr); + + if (StarShipPtr->ShipInfo.icons != NULL) + // Skip the Ur-Quan probe. + { + StarShipPtr->ShipInfo.ship_flags &= ~(GOOD_GUY | BAD_GUY); + StarShipPtr->ShipInfo.ship_flags |= GOOD_GUY; + } + + UnlockStarShip (&GLOBAL (avail_race_q), hStarShip); + } +} + +//////////////////////////////////////////////////////////////////////////// + void forAllStars (void (*callback) (STAR_DESC *, void *), void *arg) { diff --git a/sc2/src/sc2code/uqmdebug.h b/sc2/src/sc2code/uqmdebug.h index ac59494bc..34201f607 100644 --- a/sc2/src/sc2code/uqmdebug.h +++ b/sc2/src/sc2code/uqmdebug.h @@ -52,6 +52,8 @@ void equipShip (void); // Show all active spheres of influence. void showSpheres (void); +// Make the ships of all races available for building at the shipyard. +void activateAllShips (void); // Call a function for all stars. void forAllStars (void (*callback) (STAR_DESC *, void *), void *arg);