Fixed bug: Upgrade to didn't work with new orders.

This commit is contained in:
johns 2001-03-12 21:27:04 +00:00
parent b956489abd
commit dee9e14ea7
4 changed files with 10 additions and 13 deletions

View file

@ -54,7 +54,7 @@ global void HandleActionUpgradeTo(Unit* unit)
unit->Data.UpgradeTo.Ticks=0;
unit->SubAction=1;
}
type=unit->Data.UpgradeTo.What;
type=unit->Orders[0].Type;
stats=&type->Stats[player->Player];
// FIXME: Should count down here

View file

@ -1531,7 +1531,7 @@ global void CommandCancelUpgradeTo(Unit* unit)
if( unit->Orders[0].Action == UnitActionUpgradeTo ) {
PlayerAddCostsFactor(unit->Player,
unit->Data.UpgradeTo.What->Stats->Costs,
unit->Orders[0].Type->Stats->Costs,
CancelUpgradeCostsFactor);
unit->Orders[0].Action=UnitActionStill;

View file

@ -314,7 +314,6 @@ struct _unit_ {
} Research; /// Research action
struct _order_upgradeto_ {
unsigned Ticks; /// Ticks to complete
UnitType* What; /// Unit upgraded to
} UpgradeTo; /// Upgrade to action
struct _order_train_ {
unsigned Ticks; /// Ticks to complete

View file

@ -232,7 +232,7 @@ global void DrawUnitInfo(const Unit* unit)
DrawCompleted(
unit->Data.Train.What[0]
->Stats[ThisPlayer->Player].Costs[TimeCost]
->Stats[unit->Player->Player].Costs[TimeCost]
,unit->Data.Train.Ticks);
} else {
DrawTextCentered(x+114,y+8+29,GameFont,"Training...");
@ -247,7 +247,7 @@ global void DrawUnitInfo(const Unit* unit)
DrawCompleted(
unit->Data.Train.What[0]
->Stats[ThisPlayer->Player].Costs[TimeCost]
->Stats[unit->Player->Player].Costs[TimeCost]
,unit->Data.Train.Ticks);
}
return;
@ -258,13 +258,11 @@ global void DrawUnitInfo(const Unit* unit)
//
if( unit->Orders[0].Action==UnitActionUpgradeTo ) {
DrawText(x+29,y+8+78,GameFont,"Upgrading:");
DrawUnitIcon(unit->Player
,unit->Data.UpgradeTo.What->Icon.Icon
DrawUnitIcon(unit->Player,unit->Orders[0].Type->Icon.Icon
,0,x+107,y+8+70);
DrawCompleted(
unit->Data.UpgradeTo.What
->Stats[ThisPlayer->Player].Costs[TimeCost]
DrawCompleted(unit->Orders[0].Type
->Stats[unit->Player->Player].Costs[TimeCost]
,unit->Data.UpgradeTo.Ticks);
return;
}
@ -300,7 +298,7 @@ global void DrawUnitInfo(const Unit* unit)
DrawCompleted(
unit->Command.Data.Train.What[0]
->Stats[ThisPlayer->Player].Costs[TimeCost]
->Stats[unit->Player->Player].Costs[TimeCost]
,unit->Command.Data.Train.Ticks);
} else {
DrawTextCentered(x+114,y+8+29,GameFont,"Training...");
@ -315,7 +313,7 @@ global void DrawUnitInfo(const Unit* unit)
DrawCompleted(
unit->Command.Data.Train.What[0]
->Stats[ThisPlayer->Player].Costs[TimeCost]
->Stats[unit->Player->Player].Costs[TimeCost]
,unit->Command.Data.Train.Ticks);
}
return;
@ -328,7 +326,7 @@ global void DrawUnitInfo(const Unit* unit)
DrawCompleted(
unit->Command.Data.UpgradeTo.What
->Stats[ThisPlayer->Player].Costs[TimeCost]
->Stats[unit->Player->Player].Costs[TimeCost]
,unit->Command.Data.UpgradeTo.Ticks);
return;
}