v1.4.4.1 (Blood in the Water Update)

This commit is contained in:
Regalis11
2024-04-24 18:09:05 +03:00
parent 89b91d1c3e
commit ff1b8951a7
397 changed files with 15250 additions and 6479 deletions
@@ -278,6 +278,20 @@ namespace Barotrauma
}
}
/// <summary>
/// Used for purchasing upgrades from outside the upgrade store.
/// Doesn't deduct the credit, adds the upgrade to the pending list and performs a level sanity check.
/// </summary>
public void AddUpgradeExternally(UpgradePrefab prefab, UpgradeCategory category, int level)
{
int maxLevel = prefab.GetMaxLevelForCurrentSub();
int currentLevel = GetUpgradeLevel(prefab, category);
if (currentLevel + 1 > maxLevel) { return; }
PendingUpgrades.Add(new PurchasedUpgrade(prefab, category, level));
OnUpgradesChanged?.Invoke(this);
}
/// <summary>
/// Purchases an item swap and handles logic for deducting the credit.
/// </summary>