v1.1.18.0 (Treacherous Tides Update)
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -18,7 +17,7 @@ namespace Barotrauma
|
||||
public Reputation Reputation { get; }
|
||||
public FactionPrefab Prefab { get; }
|
||||
|
||||
public Faction(CampaignMetadata metadata, FactionPrefab prefab)
|
||||
public Faction(CampaignMetadata? metadata, FactionPrefab prefab)
|
||||
{
|
||||
Prefab = prefab;
|
||||
Reputation = new Reputation(metadata, this, prefab.MinReputation, prefab.MaxReputation, prefab.InitialReputation);
|
||||
|
||||
@@ -42,10 +42,10 @@ namespace Barotrauma
|
||||
|
||||
public float Value
|
||||
{
|
||||
get => Math.Min(MaxReputation, Metadata.GetFloat(metaDataIdentifier, InitialReputation));
|
||||
get => Metadata == null ? 0 : Math.Min(MaxReputation, Metadata.GetFloat(metaDataIdentifier, InitialReputation));
|
||||
private set
|
||||
{
|
||||
if (MathUtils.NearlyEqual(Value, value)) { return; }
|
||||
if (MathUtils.NearlyEqual(Value, value) || Metadata == null) { return; }
|
||||
|
||||
float prevValue = Value;
|
||||
|
||||
@@ -137,7 +137,6 @@ namespace Barotrauma
|
||||
|
||||
private Reputation(CampaignMetadata metadata, Faction faction, Location location, Identifier identifier, int minReputation, int maxReputation, int initialReputation)
|
||||
{
|
||||
System.Diagnostics.Debug.Assert(metadata != null);
|
||||
System.Diagnostics.Debug.Assert(faction != null || location != null);
|
||||
Metadata = metadata;
|
||||
Identifier = identifier;
|
||||
|
||||
Reference in New Issue
Block a user