diff --git a/sc2/src/sc2code/planets/gencol.c b/sc2/src/sc2code/planets/gencol.c index 57a47f49e..3f816449b 100644 --- a/sc2/src/sc2code/planets/gencol.c +++ b/sc2/src/sc2code/planets/gencol.c @@ -37,8 +37,8 @@ GenerateColony (BYTE control) { CloneShipFragment (URQUAN_SHIP, &GLOBAL (npc_built_ship_q), 0); - GLOBAL (BattleGroupRef) = PutGroupInfo (GROUPS_ADD_NEW, 1); + ReinitQueue (&GLOBAL (npc_built_ship_q)); SET_GAME_STATE_32 (COLONY_GRPOFFS0, GLOBAL (BattleGroupRef)); } diff --git a/sc2/src/sc2code/planets/genmel.c b/sc2/src/sc2code/planets/genmel.c index f3bd5440d..ab8fea5a4 100644 --- a/sc2/src/sc2code/planets/genmel.c +++ b/sc2/src/sc2code/planets/genmel.c @@ -102,6 +102,7 @@ GenerateMelnorme (BYTE control) CloneShipFragment (MELNORME_SHIP, &GLOBAL (npc_built_ship_q), 0); GLOBAL (BattleGroupRef) = PutGroupInfo (GROUPS_ADD_NEW, 1); + ReinitQueue (&GLOBAL (npc_built_ship_q)); SetMelnormeRef (GLOBAL (BattleGroupRef)); } GenerateRandomIP (INIT_NPCS); diff --git a/sc2/src/sc2code/planets/gensam.c b/sc2/src/sc2code/planets/gensam.c index 5b68e1b37..626b8eb7f 100644 --- a/sc2/src/sc2code/planets/gensam.c +++ b/sc2/src/sc2code/planets/gensam.c @@ -66,6 +66,8 @@ BuildUrquanGuard (void) for (b0 = 1; b0 <= NUM_URQUAN_GUARDS1; ++b0) PutGroupInfo (GLOBAL (BattleGroupRef), (BYTE)(NUM_URQUAN_GUARDS0 + b0)); + ReinitQueue (&GLOBAL (npc_built_ship_q)); + GetGroupInfo (GLOBAL (BattleGroupRef), GROUP_INIT_IP); XFormIPLoc (&pSolarSysState->PlanetDesc[4].image.origin, diff --git a/sc2/src/sc2code/planets/genshof.c b/sc2/src/sc2code/planets/genshof.c index 209ca3142..411333dc9 100644 --- a/sc2/src/sc2code/planets/genshof.c +++ b/sc2/src/sc2code/planets/genshof.c @@ -79,6 +79,7 @@ GenerateShofixti (BYTE control) GLOBAL (BattleGroupRef) = PutGroupInfo ( GLOBAL (BattleGroupRef), 1); + ReinitQueue (&GLOBAL (npc_built_ship_q)); SET_GAME_STATE_32 (SHOFIXTI_GRPOFFS0, GLOBAL (BattleGroupRef)); } diff --git a/sc2/src/sc2code/planets/gensol.c b/sc2/src/sc2code/planets/gensol.c index 1b636088c..f7d62f55b 100644 --- a/sc2/src/sc2code/planets/gensol.c +++ b/sc2/src/sc2code/planets/gensol.c @@ -415,8 +415,8 @@ GenerateSOL (BYTE control) { CloneShipFragment (URQUAN_PROBE_SHIP, &GLOBAL (npc_built_ship_q), 0); - GLOBAL (BattleGroupRef) = PutGroupInfo (GROUPS_ADD_NEW, 1); + ReinitQueue (&GLOBAL (npc_built_ship_q)); SET_GAME_STATE_32 (URQUAN_PROBE_GRPOFFS0, GLOBAL (BattleGroupRef)); } diff --git a/sc2/src/sc2code/planets/genzoq.c b/sc2/src/sc2code/planets/genzoq.c index 937b668a2..62506fafb 100644 --- a/sc2/src/sc2code/planets/genzoq.c +++ b/sc2/src/sc2code/planets/genzoq.c @@ -62,8 +62,8 @@ GenerateScout (BYTE control) { CloneShipFragment (ZOQFOTPIK_SHIP, &GLOBAL (npc_built_ship_q), 0); - GLOBAL (BattleGroupRef) = PutGroupInfo (GROUPS_ADD_NEW, 1); + ReinitQueue (&GLOBAL (npc_built_ship_q)); SET_GAME_STATE_32 (ZOQFOT_GRPOFFS0, GLOBAL (BattleGroupRef)); } diff --git a/sc2/src/sc2code/planets/lander.c b/sc2/src/sc2code/planets/lander.c index ee5bca43c..3fcc6c666 100644 --- a/sc2/src/sc2code/planets/lander.c +++ b/sc2/src/sc2code/planets/lander.c @@ -892,15 +892,23 @@ lightning_process (ELEMENT *ElementPtr) else { SIZE s; +#define NUM_CYCLES 8 + static const COLOR color_tab[] = + { + BUILD_COLOR (MAKE_RGB15 (0x11, 0x11, 0x11), 0x18), + BUILD_COLOR (MAKE_RGB15 (0x13, 0x13, 0x13), 0x17), + BUILD_COLOR (MAKE_RGB15 (0x15, 0x15, 0x15), 0x15), + BUILD_COLOR (MAKE_RGB15 (0x17, 0x17, 0x17), 0x14), + BUILD_COLOR (MAKE_RGB15 (0x19, 0x19, 0x19), 0x13), + BUILD_COLOR (MAKE_RGB15 (0x1B, 0x1B, 0x1B), 0x12), + BUILD_COLOR (MAKE_RGB15 (0x1D, 0x1D, 0x1D), 0x10), + BUILD_COLOR (MAKE_RGB15 (0x1F, 0x1F, 0x1F), 0x0f), + }; - // XXX: Color cycling is largely unused, because the color - // never actually changes RGB values (see MAKE_RGB15 below). - // This did, however, work in DOS SC2 version (fade effect). - s = 7 - ((SIZE)ElementPtr->cycle - (SIZE)ElementPtr->life_span); - if (s < 0) - s = 0; - // XXX: Was 0x8000 the background flag on 3DO? - SetPrimColor (pPrim, BUILD_COLOR (0x8000 | MAKE_RGB15 (0x1F, 0x1F, 0x1F), s)); + s = ElementPtr->life_span; + if (s > NUM_CYCLES - 1) + s = NUM_CYCLES - 1; + SetPrimColor (pPrim, color_tab[s]); if (ElementPtr->mass_points == LIGHTNING_DISASTER) {