Reverted patch for #413 because of previously unnoticed bug
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1144 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
Changes towards version 0.3:
|
Changes towards version 0.3:
|
||||||
- Ships are not sold unless you set their crew level to SCRAP, (bug
|
|
||||||
#413), from Paxtez
|
|
||||||
- Prevent Syreen crew above 12 getting thrown out the airlock in
|
- Prevent Syreen crew above 12 getting thrown out the airlock in
|
||||||
Roster screen (bug #184); from chmmravatar, Alex
|
Roster screen (bug #184); from chmmravatar, Alex
|
||||||
- Lander report messages now use the entire panel (bug #36), from chmmravatar
|
- Lander report messages now use the entire panel (bug #36), from chmmravatar
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ Changes are broadly classified into the following categories:
|
|||||||
NEW FEATURES
|
NEW FEATURES
|
||||||
|
|
||||||
- PC-style shipyard graphics, complete with animated power lines
|
- PC-style shipyard graphics, complete with animated power lines
|
||||||
- Selling ships in the shipyards has slightly different controls
|
|
||||||
that make it harder to sell ships accidentally
|
|
||||||
- Main menu displays version number
|
- Main menu displays version number
|
||||||
- Added a '-g' option to control gamma correction
|
- Added a '-g' option to control gamma correction
|
||||||
- Planet spin has been improved
|
- Planet spin has been improved
|
||||||
|
|||||||
+68
-54
@@ -298,8 +298,6 @@ ShowShipCrew (SHIP_FRAGMENTPTR StarShipPtr, PRECT pRect)
|
|||||||
if (StarShipPtr->ShipInfo.crew_level >=
|
if (StarShipPtr->ShipInfo.crew_level >=
|
||||||
TemplatePtr->RaceDescPtr->ship_info.crew_level)
|
TemplatePtr->RaceDescPtr->ship_info.crew_level)
|
||||||
wsprintf (buf, "%u", StarShipPtr->ShipInfo.crew_level);
|
wsprintf (buf, "%u", StarShipPtr->ShipInfo.crew_level);
|
||||||
else if (StarShipPtr->ShipInfo.crew_level == 0)
|
|
||||||
wsprintf (buf, "SCRAP");
|
|
||||||
else
|
else
|
||||||
wsprintf (buf, "%u/%u",
|
wsprintf (buf, "%u/%u",
|
||||||
StarShipPtr->ShipInfo.crew_level,
|
StarShipPtr->ShipInfo.crew_level,
|
||||||
@@ -322,9 +320,7 @@ ShowShipCrew (SHIP_FRAGMENTPTR StarShipPtr, PRECT pRect)
|
|||||||
SetContextForeGroundColor (BLACK_COLOR);
|
SetContextForeGroundColor (BLACK_COLOR);
|
||||||
DrawFilledRectangle (&r);
|
DrawFilledRectangle (&r);
|
||||||
}
|
}
|
||||||
SetContextForeGroundColor ((StarShipPtr->ShipInfo.crew_level != 0) ?
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x14, 0x00), 0x02));
|
||||||
(BUILD_COLOR (MAKE_RGB15 (0x00, 0x14, 0x00), 0x02)):
|
|
||||||
(BUILD_COLOR (MAKE_RGB15 (0x12, 0x00, 0x00), 0x2B)));
|
|
||||||
font_DrawText (&t);
|
font_DrawText (&t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -777,8 +773,9 @@ DoModifyShips (PMENU_STATE pMS)
|
|||||||
DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW);
|
DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW);
|
||||||
|
|
||||||
SetSemaphore (GraphicsSem);
|
SetSemaphore (GraphicsSem);
|
||||||
DeltaSISGauges (UNDEFINED_DELTA, UNDEFINED_DELTA,
|
DeltaSISGauges (
|
||||||
-((int)ShipCost[Index]));
|
UNDEFINED_DELTA, UNDEFINED_DELTA, -((int)ShipCost[Index])
|
||||||
|
);
|
||||||
r.corner.x = pMS->flash_rect0.corner.x;
|
r.corner.x = pMS->flash_rect0.corner.x;
|
||||||
r.corner.y = pMS->flash_rect0.corner.y
|
r.corner.y = pMS->flash_rect0.corner.y
|
||||||
+ pMS->flash_rect0.extent.height - 6;
|
+ pMS->flash_rect0.extent.height - 6;
|
||||||
@@ -819,25 +816,7 @@ DoModifyShips (PMENU_STATE pMS)
|
|||||||
}
|
}
|
||||||
else if (select || cancel)
|
else if (select || cancel)
|
||||||
{
|
{
|
||||||
|
if (!(pMS->delta_item ^= MODIFY_CREW_FLAG))
|
||||||
if (StarShipPtr->ShipInfo.crew_level == 0)
|
|
||||||
{
|
|
||||||
SetFlashRect (NULL_PTR, (FRAME)0);
|
|
||||||
ClearSemaphore (GraphicsSem);
|
|
||||||
ShowCombatShip ((COUNT)pMS->CurState, StarShipPtr);
|
|
||||||
SetSemaphore (GraphicsSem);
|
|
||||||
UnlockStarShip (&GLOBAL (built_ship_q), hStarShip);
|
|
||||||
RemoveQueue (&GLOBAL (built_ship_q), hStarShip);
|
|
||||||
FreeStarShip (&GLOBAL (built_ship_q), hStarShip);
|
|
||||||
r.corner.x = pMS->flash_rect0.corner.x;
|
|
||||||
r.corner.y = pMS->flash_rect0.corner.y;
|
|
||||||
r.extent.width = SHIP_WIN_WIDTH;
|
|
||||||
r.extent.height = SHIP_WIN_HEIGHT;
|
|
||||||
SetContext (SpaceContext);
|
|
||||||
SetFlashRect (&r, (FRAME)0);
|
|
||||||
pMS->delta_item ^= MODIFY_CREW_FLAG;
|
|
||||||
}
|
|
||||||
else if (!(pMS->delta_item ^= MODIFY_CREW_FLAG))
|
|
||||||
goto ChangeFlashRect;
|
goto ChangeFlashRect;
|
||||||
else if (hStarShip == 0)
|
else if (hStarShip == 0)
|
||||||
{
|
{
|
||||||
@@ -867,7 +846,7 @@ DoModifyShips (PMENU_STATE pMS)
|
|||||||
);
|
);
|
||||||
|
|
||||||
crew_delta = 0;
|
crew_delta = 0;
|
||||||
if (dy < 0)
|
if (dx < 0 || dy < 0)
|
||||||
{
|
{
|
||||||
if (hStarShip == 0)
|
if (hStarShip == 0)
|
||||||
{
|
{
|
||||||
@@ -897,19 +876,17 @@ DoModifyShips (PMENU_STATE pMS)
|
|||||||
TemplatePtr = (SHIP_FRAGMENTPTR)LockStarShip (
|
TemplatePtr = (SHIP_FRAGMENTPTR)LockStarShip (
|
||||||
&GLOBAL (avail_race_q), hTemplate
|
&GLOBAL (avail_race_q), hTemplate
|
||||||
);
|
);
|
||||||
if (GLOBAL_SIS (ResUnits) >= (DWORD)GLOBAL (CrewCost)
|
if (GLOBAL_SIS (ResUnits) >=
|
||||||
|
(DWORD)GLOBAL (CrewCost)
|
||||||
|
&& StarShipPtr->ShipInfo.crew_level <
|
||||||
|
StarShipPtr->ShipInfo.max_crew
|
||||||
&& StarShipPtr->ShipInfo.crew_level <
|
&& StarShipPtr->ShipInfo.crew_level <
|
||||||
StarShipPtr->ShipInfo.max_crew &&
|
|
||||||
StarShipPtr->ShipInfo.crew_level <
|
|
||||||
TemplatePtr->RaceDescPtr->ship_info.crew_level)
|
TemplatePtr->RaceDescPtr->ship_info.crew_level)
|
||||||
{
|
{
|
||||||
if (StarShipPtr->ShipInfo.crew_level > 0)
|
DeltaSISGauges (0, 0, -GLOBAL (CrewCost));
|
||||||
DeltaSISGauges (0, 0, -GLOBAL (CrewCost));
|
|
||||||
else
|
|
||||||
DeltaSISGauges (UNDEFINED_DELTA,UNDEFINED_DELTA,
|
|
||||||
-(COUNT)ShipCost[GET_RACE_ID (StarShipPtr)]);
|
|
||||||
++StarShipPtr->ShipInfo.crew_level;
|
++StarShipPtr->ShipInfo.crew_level;
|
||||||
crew_delta = 1;
|
crew_delta = 1;
|
||||||
|
|
||||||
ShowShipCrew (StarShipPtr, &pMS->flash_rect0);
|
ShowShipCrew (StarShipPtr, &pMS->flash_rect0);
|
||||||
r.corner.x = pMS->flash_rect0.corner.x;
|
r.corner.x = pMS->flash_rect0.corner.x;
|
||||||
r.corner.y = pMS->flash_rect0.corner.y
|
r.corner.y = pMS->flash_rect0.corner.y
|
||||||
@@ -924,7 +901,7 @@ DoModifyShips (PMENU_STATE pMS)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (dy > 0)
|
else if (dx > 0 || dy > 0)
|
||||||
{
|
{
|
||||||
crew_bought = (SIZE)MAKE_WORD (
|
crew_bought = (SIZE)MAKE_WORD (
|
||||||
GET_GAME_STATE (CREW_PURCHASED0),
|
GET_GAME_STATE (CREW_PURCHASED0),
|
||||||
@@ -935,8 +912,7 @@ DoModifyShips (PMENU_STATE pMS)
|
|||||||
if (GetCrewCount ())
|
if (GetCrewCount ())
|
||||||
{
|
{
|
||||||
DeltaSISGauges (-1, 0, GLOBAL (CrewCost)
|
DeltaSISGauges (-1, 0, GLOBAL (CrewCost)
|
||||||
- (crew_bought ==
|
- (crew_bought == CREW_EXPENSE_THRESHOLD ? 2 : 0));
|
||||||
CREW_EXPENSE_THRESHOLD ? 2 : 0));
|
|
||||||
crew_delta = -1;
|
crew_delta = -1;
|
||||||
|
|
||||||
GetCPodCapacity (&r.corner);
|
GetCPodCapacity (&r.corner);
|
||||||
@@ -949,20 +925,13 @@ DoModifyShips (PMENU_STATE pMS)
|
|||||||
SetContext (SpaceContext);
|
SetContext (SpaceContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (StarShipPtr->ShipInfo.crew_level > 1)
|
||||||
{
|
{
|
||||||
if (StarShipPtr->ShipInfo.crew_level > 0)
|
DeltaSISGauges (0, 0, GLOBAL (CrewCost)
|
||||||
{
|
- (crew_bought == CREW_EXPENSE_THRESHOLD ? 2 : 0));
|
||||||
if (StarShipPtr->ShipInfo.crew_level > 1)
|
crew_delta = -1;
|
||||||
DeltaSISGauges (0, 0, GLOBAL (CrewCost)
|
--StarShipPtr->ShipInfo.crew_level;
|
||||||
- (crew_bought ==
|
|
||||||
CREW_EXPENSE_THRESHOLD ? 2 : 0));
|
|
||||||
else
|
|
||||||
DeltaSISGauges (UNDEFINED_DELTA,UNDEFINED_DELTA,
|
|
||||||
(COUNT)ShipCost[GET_RACE_ID (StarShipPtr)]);
|
|
||||||
crew_delta = -1;
|
|
||||||
--StarShipPtr->ShipInfo.crew_level;
|
|
||||||
}
|
|
||||||
ShowShipCrew (StarShipPtr, &pMS->flash_rect0);
|
ShowShipCrew (StarShipPtr, &pMS->flash_rect0);
|
||||||
r.corner.x = pMS->flash_rect0.corner.x;
|
r.corner.x = pMS->flash_rect0.corner.x;
|
||||||
r.corner.y = pMS->flash_rect0.corner.y
|
r.corner.y = pMS->flash_rect0.corner.y
|
||||||
@@ -972,6 +941,53 @@ DoModifyShips (PMENU_STATE pMS)
|
|||||||
SetContext (SpaceContext);
|
SetContext (SpaceContext);
|
||||||
SetFlashRect (&r, (FRAME)0);
|
SetFlashRect (&r, (FRAME)0);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
COUNT ResUnits;
|
||||||
|
|
||||||
|
ResUnits = (COUNT)ShipCost[
|
||||||
|
GET_RACE_ID (StarShipPtr)
|
||||||
|
];
|
||||||
|
crew_delta = -(StarShipPtr->ShipInfo.crew_level - 1);
|
||||||
|
crew_bought = (SIZE)MAKE_WORD (
|
||||||
|
GET_GAME_STATE (CREW_PURCHASED0),
|
||||||
|
GET_GAME_STATE (CREW_PURCHASED1)
|
||||||
|
) - CREW_EXPENSE_THRESHOLD;
|
||||||
|
if (crew_bought <= 0 || (crew_bought += crew_delta) >= 0)
|
||||||
|
crew_bought = -crew_delta;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ResUnits += -crew_bought
|
||||||
|
* (GLOBAL (CrewCost) - 2);
|
||||||
|
crew_bought -= crew_delta;
|
||||||
|
}
|
||||||
|
ResUnits += crew_bought * GLOBAL (CrewCost);
|
||||||
|
|
||||||
|
SetFlashRect (NULL_PTR, (FRAME)0);
|
||||||
|
ClearSemaphore (GraphicsSem);
|
||||||
|
ShowCombatShip ((COUNT)pMS->CurState, StarShipPtr);
|
||||||
|
SetSemaphore (GraphicsSem);
|
||||||
|
pMS->flash_rect0.extent.width = SHIP_WIN_WIDTH;
|
||||||
|
SetFlashRect (&pMS->flash_rect0, (FRAME)0);
|
||||||
|
|
||||||
|
UnlockStarShip (
|
||||||
|
&GLOBAL (built_ship_q), hStarShip
|
||||||
|
);
|
||||||
|
|
||||||
|
RemoveQueue (
|
||||||
|
&GLOBAL (built_ship_q), hStarShip
|
||||||
|
);
|
||||||
|
FreeStarShip (
|
||||||
|
&GLOBAL (built_ship_q), hStarShip
|
||||||
|
);
|
||||||
|
|
||||||
|
DeltaSISGauges (
|
||||||
|
UNDEFINED_DELTA, UNDEFINED_DELTA, ResUnits
|
||||||
|
);
|
||||||
|
hStarShip = 0;
|
||||||
|
|
||||||
|
pMS->delta_item ^= MODIFY_CREW_FLAG;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hStarShip)
|
if (hStarShip)
|
||||||
@@ -979,10 +995,8 @@ DoModifyShips (PMENU_STATE pMS)
|
|||||||
UnlockStarShip (
|
UnlockStarShip (
|
||||||
&GLOBAL (built_ship_q), hStarShip
|
&GLOBAL (built_ship_q), hStarShip
|
||||||
);
|
);
|
||||||
if ((pMS->delta_item != MODIFY_CREW_FLAG)
|
|
||||||
&& (pMS->delta_item != 0))
|
|
||||||
pMS->delta_item = MODIFY_CREW_FLAG;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CrewTransaction (crew_delta);
|
CrewTransaction (crew_delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user