Skip to content

Commit

Permalink
Fix config purchase not checking for unlock credit
Browse files Browse the repository at this point in the history
  • Loading branch information
siimav committed Jun 11, 2024
1 parent dfe9cad commit 9905219
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Source/ModuleROHeatshield.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,13 @@ public bool IsConfigUnlocked(string configName)

public bool PurchaseConfig(PartUpgradeHandler.Upgrade upgd)
{
if (Funding.CanAfford(upgd.entryCost))
{
PartUpgradeManager.Handler.SetUnlocked(upgd.name, true);
GameEvents.OnPartUpgradePurchased.Fire(upgd);
return true;
}
CurrencyModifierQuery cmq = CurrencyModifierQuery.RunQuery(TransactionReasons.RnDPartPurchase, -upgd.entryCost, 0, 0);
if (!cmq.CanAfford())
return false;

return false;
PartUpgradeManager.Handler.SetUnlocked(upgd.name, true);
GameEvents.OnPartUpgradePurchased.Fire(upgd);
return true;
}

private void UpdatePresetsList(string[] presetNames)
Expand Down

0 comments on commit 9905219

Please sign in to comment.