Host can disable spawning of certain characters

GUITickBox might not work very well because of the override of Rect, might want to look into that later
This commit is contained in:
juanjp600
2016-10-03 22:27:32 -03:00
parent e1296e4a8e
commit 1187686449
5 changed files with 83 additions and 10 deletions
+9
View File
@@ -47,6 +47,15 @@ namespace Barotrauma
private void SpawnMonsters()
{
if (GameMain.Server != null)
{
string tryKey = GameMain.Server.monsterNames.Find(s => characterFile.ToLower().Contains(s.ToLower()));
if (tryKey != null)
{
if (!GameMain.Server.monsterEnabled[tryKey]) return; //spawn was disallowed by host
}
}
float minDist = Math.Max(Submarine.MainSub.Borders.Width, Submarine.MainSub.Borders.Height);
//find a random spawnpos that isn't too close to the main sub