From eca9f0580cd2d4ec98e1e12a4e2f8bf149f4e3d1 Mon Sep 17 00:00:00 2001 From: meep-eep Date: Wed, 4 Jan 2006 16:31:29 +0000 Subject: [PATCH] Added activateAllShips(). git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2148 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/uqmdebug.c | 30 +++++++++++++++++++++++++++++- sc2/src/sc2code/uqmdebug.h | 2 ++ 2 files changed, 31 insertions(+), 1 deletion(-) 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);