Add a 'refundableValue' parameter to 'Produce'

This commit is contained in:
abcdefg30
2020-09-08 19:49:54 +02:00
committed by reaperrr
parent cc2e369475
commit 0dac4520ad
10 changed files with 18 additions and 18 deletions

View File

@@ -570,10 +570,10 @@ namespace OpenRA.Mods.Common.Traits
var bi = unit.TraitInfo<BuildableInfo>();
var type = developerMode.AllTech ? Info.Type : (bi.BuildAtProductionType ?? Info.Type);
if (!mostLikelyProducerTrait.IsTraitPaused && mostLikelyProducerTrait.Produce(self, unit, type, inits))
var item = Queue.First(i => i.Done && i.Item == unit.Name);
if (!mostLikelyProducerTrait.IsTraitPaused && mostLikelyProducerTrait.Produce(self, unit, type, inits, item.TotalCost))
{
EndProduction(Queue.FirstOrDefault(i => i.Done && i.Item == unit.Name));
EndProduction(item);
return true;
}