fix logic

This commit is contained in:
CWX
2025-01-29 11:30:12 +00:00
parent f8ce007a64
commit 5c30fa1152
+6 -1
View File
@@ -10,6 +10,7 @@ public class PaymentHelper(ConfigServer _configServer)
{
protected InventoryConfig _inventoryConfig = _configServer.GetConfig<InventoryConfig>();
protected List<string> _moneyTpls = [Money.DOLLARS, Money.EUROS, Money.ROUBLES, Money.GP];
protected bool _addedCustomMoney;
/// <summary>
/// Is the passed in tpl money (also checks custom currencies in inventoryConfig.customMoneyTpls)
@@ -18,7 +19,11 @@ public class PaymentHelper(ConfigServer _configServer)
/// <returns></returns>
public bool IsMoneyTpl(string tpl)
{
_moneyTpls.AddRange(_inventoryConfig.CustomMoneyTpls);
if (!_addedCustomMoney)
{
_moneyTpls.AddRange(_inventoryConfig.CustomMoneyTpls);
_addedCustomMoney = true;
}
return _moneyTpls.Contains(tpl);
}