v0.19.0.0 (unstable)

This commit is contained in:
Regalis11
2022-07-20 18:47:07 +03:00
parent 2e2663a175
commit 6b55adcdd9
170 changed files with 2769 additions and 1634 deletions
@@ -1,5 +1,4 @@
using Barotrauma.Networking;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -66,19 +65,16 @@ namespace Barotrauma
if (Job != null)
{
msg.Write(Job.Prefab.Identifier);
msg.Write(Job.Prefab.UintIdentifier);
msg.Write((byte)Job.Variant);
var skills = Job.GetSkills();
msg.Write((byte)skills.Count());
foreach (Skill skill in skills)
foreach (SkillPrefab skillPrefab in Job.Prefab.Skills.OrderBy(s => s.Identifier))
{
msg.Write(skill.Identifier);
msg.Write(skill.Level);
msg.Write(Job.GetSkill(skillPrefab.Identifier).Level);
}
}
else
{
msg.Write("");
msg.Write((uint)0);
msg.Write((byte)0);
}
@@ -359,11 +359,12 @@ namespace Barotrauma
tempBuffer.Write(AnimController.Dir > 0.0f);
}
if (SelectedCharacter != null || SelectedConstruction != null)
if (SelectedCharacter != null || HasSelectedAnyItem)
{
tempBuffer.Write(true);
tempBuffer.Write(SelectedCharacter != null ? SelectedCharacter.ID : NullEntityID);
tempBuffer.Write(SelectedConstruction != null ? SelectedConstruction.ID : NullEntityID);
tempBuffer.Write(SelectedItem != null ? SelectedItem.ID : NullEntityID);
tempBuffer.Write(SelectedSecondaryItem != null ? SelectedSecondaryItem.ID : NullEntityID);
if (SelectedCharacter != null)
{
tempBuffer.Write(AnimController.Anim == AnimController.Animation.CPR);
@@ -424,8 +425,8 @@ namespace Barotrauma
msg.Write(owner == c && owner.Character == this);
msg.Write(owner != null && owner.Character == this && GameMain.Server.ConnectedClients.Contains(owner) ? owner.ID : (byte)0);
break;
case CharacterStatusEventData _:
WriteStatus(msg);
case CharacterStatusEventData statusEventData:
WriteStatus(msg, statusEventData.ForceAfflictionData);
break;
case UpdateSkillsEventData _:
if (Info?.Job == null)
@@ -573,7 +574,7 @@ namespace Barotrauma
msg.WriteRangedInteger((int)CauseOfDeath.Type, 0, Enum.GetValues(typeof(CauseOfDeathType)).Length - 1);
if (CauseOfDeath.Type == CauseOfDeathType.Affliction)
{
msg.Write(CauseOfDeath.Affliction.Identifier);
msg.Write(CauseOfDeath.Affliction.UintIdentifier);
}
msg.Write(forceAfflictionData);
if (forceAfflictionData)