Host can have subs spawn with more items

TODO: check if clients see the extra cargo, they probably don't
This commit is contained in:
juanjp600
2016-10-04 22:27:10 -03:00
parent 6f136c8daf
commit 4874ad2ef8
6 changed files with 243 additions and 40 deletions
+5 -2
View File
@@ -1,6 +1,8 @@
using System.Xml.Linq;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Barotrauma
{
@@ -49,8 +51,9 @@ namespace Barotrauma
{
if (GameMain.Server != null)
{
string tryKey = GameMain.Server.monsterNames.Find(s => characterFile.ToLower().Contains(s.ToLower()));
if (tryKey != null)
List<string> monsterNames = GameMain.Server.monsterEnabled.Keys.ToList();
string tryKey = monsterNames.Find(s => characterFile.ToLower().Contains(s.ToLower()));
if (!string.IsNullOrWhiteSpace(tryKey))
{
if (!GameMain.Server.monsterEnabled[tryKey]) return; //spawn was disallowed by host
}