Added activateAllShips().

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2148 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2006-01-04 16:31:29 +00:00
parent 50ac4cf1fd
commit eca9f0580c
2 changed files with 31 additions and 1 deletions
+28
View File
@@ -65,6 +65,7 @@ debugKeyPressed (void)
equipShip (); equipShip ();
instantMove = !instantMove; instantMove = !instantMove;
showSpheres (); showSpheres ();
activateAllShips ();
// forwardToNextEvent (TRUE); // forwardToNextEvent (TRUE);
// Tests // Tests
@@ -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 void
forAllStars (void (*callback) (STAR_DESC *, void *), void *arg) forAllStars (void (*callback) (STAR_DESC *, void *), void *arg)
{ {
+2
View File
@@ -52,6 +52,8 @@ void equipShip (void);
// Show all active spheres of influence. // Show all active spheres of influence.
void showSpheres (void); void showSpheres (void);
// Make the ships of all races available for building at the shipyard.
void activateAllShips (void);
// Call a function for all stars. // Call a function for all stars.
void forAllStars (void (*callback) (STAR_DESC *, void *), void *arg); void forAllStars (void (*callback) (STAR_DESC *, void *), void *arg);