Unstable 0.1400.2.0 (a mimir edition)

This commit is contained in:
Markus Isberg
2021-05-28 19:04:09 +03:00
parent 5bc850cddb
commit 0b3fb5e440
126 changed files with 1623 additions and 787 deletions
@@ -283,7 +283,7 @@ namespace Barotrauma
if (extraData != null)
{
int min = 0, max = 9;
const int min = 0, max = 9;
switch ((NetEntityEvent.Type)extraData[0])
{
case NetEntityEvent.Type.InventoryState:
@@ -331,6 +331,7 @@ namespace Barotrauma
case NetEntityEvent.Type.AssignCampaignInteraction:
msg.WriteRangedInteger(6, min, max);
msg.Write((byte)CampaignInteractionType);
msg.Write(RequireConsciousnessForCustomInteract);
break;
case NetEntityEvent.Type.ObjectiveManagerState:
msg.WriteRangedInteger(7, min, max);
@@ -19,12 +19,10 @@ namespace Barotrauma
{
character.WriteSpawnData(msg, character.ID, restrictMessageSize: false);
msg.Write(terroristCharacters.Contains(character));
List<Item> characterItems = characterDictionary[character];
// items must be written in a specific sequence so that child items aren't written before their parents
msg.Write((ushort)characterItems.Count());
foreach (Item item in characterItems)
msg.Write((ushort)characterItems[character].Count());
foreach (Item item in characterItems[character])
{
item.WriteSpawnData(msg, item.ID, item.ParentInventory.Owner?.ID ?? Entity.NullEntityID, 0);
item.WriteSpawnData(msg, item.ID, item.ParentInventory?.Owner?.ID ?? Entity.NullEntityID, 0);
}
}
}
@@ -19,12 +19,10 @@ namespace Barotrauma
foreach (Character character in characters)
{
character.WriteSpawnData(msg, character.ID, restrictMessageSize: false);
List<Item> characterItems = characterDictionary[character];
// items must be written in a specific sequence so that child items aren't written before their parents
msg.Write((ushort)characterItems.Count());
foreach (Item item in characterItems)
msg.Write((ushort)characterItems[character].Count());
foreach (Item item in characterItems[character])
{
item.WriteSpawnData(msg, item.ID, item.ParentInventory.Owner?.ID ?? Entity.NullEntityID, 0);
item.WriteSpawnData(msg, item.ID, item.ParentInventory?.Owner?.ID ?? Entity.NullEntityID, 0);
}
}
}
@@ -260,9 +260,13 @@ namespace Barotrauma
{
Submarine.MainSub = leavingSub;
GameMain.GameSession.Submarine = leavingSub;
GameMain.GameSession.SubmarineInfo = leavingSub.Info;
leavingSub.Info.FilePath = System.IO.Path.Combine(SaveUtil.TempPath, leavingSub.Info.Name + ".sub");
var subsToLeaveBehind = GetSubsToLeaveBehind(leavingSub);
GameMain.GameSession.OwnedSubmarines.Add(leavingSub.Info);
foreach (Submarine sub in subsToLeaveBehind)
{
GameMain.GameSession.OwnedSubmarines.RemoveAll(s => s != leavingSub.Info && s.Name == sub.Info.Name);
MapEntity.mapEntityList.RemoveAll(e => e.Submarine == sub && e is LinkedSubmarine);
LinkedSubmarine.CreateDummy(leavingSub, sub);
}