(ae643deeb) Added alive checks to a couple of diving gear status effects (don't consume tanks when dead)
This commit is contained in:
@@ -103,12 +103,6 @@ namespace Barotrauma
|
||||
if (missionType == MissionType.Random)
|
||||
{
|
||||
allowedMissions.AddRange(MissionPrefab.List);
|
||||
#if SERVER
|
||||
if (GameMain.Server != null)
|
||||
{
|
||||
allowedMissions.RemoveAll(mission => !GameMain.Server.ServerSettings.AllowedRandomMissionTypes.Contains(mission.type));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (missionType == MissionType.None)
|
||||
{
|
||||
@@ -124,6 +118,11 @@ namespace Barotrauma
|
||||
{
|
||||
allowedMissions.RemoveAll(m => !m.IsAllowed(locations[0], locations[1]));
|
||||
}
|
||||
|
||||
if (allowedMissions.Count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int probabilitySum = allowedMissions.Sum(m => m.Commonness);
|
||||
int randomNumber = rand.NextInt32() % probabilitySum;
|
||||
|
||||
Reference in New Issue
Block a user