(a6f17618b) Allow canceling repairs in the campaign menu, fixed credits not being displayed in the repair tab

This commit is contained in:
Joonas Rikkonen
2019-04-17 12:43:11 +03:00
parent ee2326db63
commit 8c8f03ae25
2 changed files with 53 additions and 21 deletions
@@ -212,15 +212,31 @@ namespace Barotrauma
return;
}
if (purchasedHullRepairs && !this.PurchasedHullRepairs && Money >= HullRepairCost)
if (purchasedHullRepairs != this.PurchasedHullRepairs)
{
this.PurchasedHullRepairs = true;
Money -= HullRepairCost;
if (purchasedHullRepairs && Money >= HullRepairCost)
{
this.PurchasedHullRepairs = true;
Money -= HullRepairCost;
}
else if (!purchasedHullRepairs)
{
this.PurchasedHullRepairs = false;
Money += HullRepairCost;
}
}
if (purchasedItemRepairs && !this.PurchasedItemRepairs && Money >= ItemRepairCost)
if (purchasedItemRepairs != this.PurchasedItemRepairs)
{
this.PurchasedItemRepairs = true;
Money -= ItemRepairCost;
if (purchasedItemRepairs && Money >= ItemRepairCost)
{
this.PurchasedItemRepairs = true;
Money -= ItemRepairCost;
}
else if (!purchasedItemRepairs)
{
this.PurchasedItemRepairs = false;
Money += ItemRepairCost;
}
}
Map.SelectLocation(selectedLocIndex == UInt16.MaxValue ? -1 : selectedLocIndex);