(965c31410) v0.10.4.0

This commit is contained in:
Joonas Rikkonen
2020-07-30 13:00:09 +03:00
parent eeac247a8e
commit 4978af3d60
539 changed files with 45803 additions and 25359 deletions
@@ -1,5 +1,8 @@
using Barotrauma.Networking;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using Barotrauma.Networking;
namespace Barotrauma
{
@@ -19,5 +22,23 @@ namespace Barotrauma
pendingConversationLines.AddRange(NPCConversation.CreateRandom(availableSpeakers));
}
/// <summary>
/// Saves bots in multiplayer
/// </summary>
/// <param name="root"></param>
public void SaveMultiplayer(XElement root)
{
XElement saveElement = new XElement("bots", new XAttribute("hasbots", HasBots));
foreach (CharacterInfo info in characterInfos)
{
if (info?.Character == null || info.Character.IsDead) { continue; }
XElement characterElement = info.Save(saveElement);
if (info.InventoryData != null) { characterElement.Add(info.InventoryData); }
if (info.HealthData != null) { characterElement.Add(info.HealthData); }
}
root.Add(saveElement);
}
}
}