Fixed mutliplayer-only missions being taken into account in the eventprobability calculation even in single player mode, which missions are sp/mp-only is determined in the mission config files
This commit is contained in:
@@ -148,8 +148,15 @@ namespace Barotrauma
|
||||
matchingElements = doc.Root.Elements().ToList().FindAll(m => m.Name.ToString().ToLowerInvariant().Replace("mission", "") == missionType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (isSinglePlayer)
|
||||
{
|
||||
matchingElements.RemoveAll(m => ToolBox.GetAttributeBool(m, "multiplayeronly", false));
|
||||
}
|
||||
else
|
||||
{
|
||||
matchingElements.RemoveAll(m => ToolBox.GetAttributeBool(m, "singleplayeronly", false));
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
foreach (XElement element in matchingElements)
|
||||
{
|
||||
@@ -185,8 +192,6 @@ namespace Barotrauma
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isSinglePlayer && t.GetInterface("Barotrauma.SinglePlayerMission")==null) continue;
|
||||
|
||||
ConstructorInfo constructor = t.GetConstructor(new[] { typeof(XElement) });
|
||||
|
||||
object instance = constructor.Invoke(new object[] { element });
|
||||
@@ -253,9 +258,4 @@ namespace Barotrauma
|
||||
mode.Money += reward;
|
||||
}
|
||||
}
|
||||
|
||||
interface SinglePlayerMission
|
||||
{
|
||||
//all valid single player missions should inherit this
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user