diff --git a/sc2/ChangeLog b/sc2/ChangeLog index dbe7c8fd7..0e19c1f87 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,6 @@ Changes towards version 0.6: +- Crew retrieved from space after the end of an encounter will no + longer set the crew larger than the ship's maximum. - SvdB - Flagship crew numbers are no longer continuously synchronised during melee, but only at the beginning and end of the battle. - SvdB - Various small cleanups. - SvdB diff --git a/sc2/src/sc2code/init.c b/sc2/src/sc2code/init.c index 39ddd6c56..e779a4751 100644 --- a/sc2/src/sc2code/init.c +++ b/sc2/src/sc2code/init.c @@ -232,11 +232,21 @@ UninitShips (void) STARSHIPPTR StarShipPtr; GetElementStarShip (ElementPtr, &StarShipPtr); + // There should only be one ship left in battle. // He gets the crew still floating in space. if (StarShipPtr->RaceDescPtr->ship_info.crew_level) - StarShipPtr->RaceDescPtr->ship_info.crew_level += - crew_retrieved; + { + if (crew_retrieved >= + StarShipPtr->RaceDescPtr->ship_info.max_crew - + StarShipPtr->RaceDescPtr->ship_info.crew_level) + StarShipPtr->RaceDescPtr->ship_info.crew_level = + StarShipPtr->RaceDescPtr->ship_info.max_crew; + else + StarShipPtr->RaceDescPtr->ship_info.crew_level += + crew_retrieved; + } + if (StarShipPtr->RaceDescPtr->uninit_func != NULL) (*StarShipPtr->RaceDescPtr->uninit_func) ( StarShipPtr->RaceDescPtr);