(ef1d7a5a2) Campaign fix: clear missions from locations that change their type, and all adjacent locations. Caused missions to still be available when they logically shouldn't be (e.g. a transport mission from an uninhabited location to another) and syncing issues in multiplayer.
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)
|
||||
{
|
||||
@@ -125,8 +119,8 @@ namespace Barotrauma
|
||||
allowedMissions.RemoveAll(m => !m.IsAllowed(locations[0], locations[1]));
|
||||
}
|
||||
|
||||
float probabilitySum = allowedMissions.Sum(m => m.Commonness);
|
||||
float randomNumber = (float)rand.NextDouble() * probabilitySum;
|
||||
int probabilitySum = allowedMissions.Sum(m => m.Commonness);
|
||||
int randomNumber = rand.NextInt32() % probabilitySum;
|
||||
foreach (MissionPrefab missionPrefab in allowedMissions)
|
||||
{
|
||||
if (randomNumber <= missionPrefab.Commonness)
|
||||
|
||||
Reference in New Issue
Block a user