- Fixed clients using character directories to count the number of disallowed monsters, which made it possible for them to disallow incorrect monsters.
- Fixed MonsterEvent checking if the name of the character directory contains the name of the disallowed character directory, which could for example cause them to disallow "someMonsterAlt" if "someMonster" is disallowed.
This commit is contained in:
@@ -701,15 +701,16 @@ namespace Barotrauma.Networking
|
||||
//monster spawn settings
|
||||
if (monsterEnabled == null)
|
||||
{
|
||||
List<string> monsterNames1 = Directory.GetDirectories("Content/Characters").ToList();
|
||||
List<string> monsterNames1 = GameMain.Config.SelectedContentPackage.GetFilesOfType(ContentType.Character);
|
||||
for (int i = 0; i < monsterNames1.Count; i++)
|
||||
{
|
||||
monsterNames1[i] = monsterNames1[i].Replace("Content/Characters", "").Replace("/", "").Replace("\\", "");
|
||||
monsterNames1[i] = Path.GetFileName(Path.GetDirectoryName(monsterNames1[i]));
|
||||
}
|
||||
|
||||
monsterEnabled = new Dictionary<string, bool>();
|
||||
foreach (string s in monsterNames1)
|
||||
{
|
||||
monsterEnabled.Add(s, true);
|
||||
if (!monsterEnabled.ContainsKey(s)) monsterEnabled.Add(s, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user