mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
fix unhandled ArgumentException when a duplicate shop cost modifier is added (#42064)
* add map containskey check * review --------- Co-authored-by: AJCM-git <ajcm_mail@disroot.org>
This commit is contained in:
parent
d0ea59ca41
commit
41ecaa27d0
1 changed files with 2 additions and 3 deletions
|
|
@ -346,11 +346,10 @@ public sealed partial class ListingDataWithCostModifiers : ListingData
|
|||
/// <param name="modifiers">Values for cost modification.</param>
|
||||
public void AddCostModifier(string modifierSourceId, Dictionary<ProtoId<CurrencyPrototype>, FixedPoint2> modifiers)
|
||||
{
|
||||
CostModifiersBySourceId.Add(modifierSourceId, modifiers);
|
||||
CostModifiersBySourceId.TryAdd(modifierSourceId, modifiers);
|
||||
|
||||
if (_costModified != null)
|
||||
{
|
||||
_costModified = ApplyAllModifiers();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Remove cost modifier with passed sourceId. </summary>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue