From 2662ce0085d6ff087c89d248b1035e082d0b3c59 Mon Sep 17 00:00:00 2001 From: johns <> Date: Wed, 28 Feb 2001 15:42:44 +0000 Subject: [PATCH] Added cancel costs factor. --- src/action/command.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/action/command.cpp b/src/action/command.cpp index 8feb06cca..994330778 100644 --- a/src/action/command.cpp +++ b/src/action/command.cpp @@ -896,8 +896,10 @@ global void CommandCancelTraining(Unit* unit,int slot) // n=unit->Command.Data.Train.Count; if( unit->Command.Action==UnitActionTrain && slotPlayer,unit->Command.Data.Train.What[slot]); + PlayerAddCostsFactor(unit->Player, + unit->Command.Data.Train.What[slot] + ->Stats[unit->Player->Player].Costs, + CancelTrainingCostsFactor); if ( --n ) { for( i = slot; i < n; i++ ) { @@ -998,7 +1000,8 @@ global void CommandCancelUpgradeTo(Unit* unit) if( unit->Command.Action == UnitActionUpgradeTo ) { PlayerAddCostsFactor(unit->Player, - unit->Command.Data.UpgradeTo.What->Stats->Costs,75); + unit->Command.Data.UpgradeTo.What->Stats->Costs, + CancelUpgradeCostsFactor); unit->Command.Action=UnitActionStill; @@ -1087,8 +1090,9 @@ global void CommandCancelResearch(Unit* unit) // Check if unit is still researching? (NETWORK!) // if( unit->Command.Action == UnitActionResearch ) { - PlayerAddCostsFactor(unit->Player - ,unit->Command.Data.Research.What->Costs,75); + PlayerAddCostsFactor(unit->Player, + unit->Command.Data.UpgradeTo.What->Stats->Costs, + CancelResearchCostsFactor); unit->Command.Action=UnitActionStill;