Unstable 0.1500.5.0 (almost forgor edition 💀)
This commit is contained in:
@@ -3791,7 +3791,7 @@ namespace Barotrauma.Networking
|
||||
return preferredClient;
|
||||
}
|
||||
|
||||
public void UpdateMissionState(Mission mission, int state)
|
||||
public void UpdateMissionState(Mission mission)
|
||||
{
|
||||
foreach (var client in connectedClients)
|
||||
{
|
||||
@@ -3799,7 +3799,7 @@ namespace Barotrauma.Networking
|
||||
msg.Write((byte)ServerPacketHeader.MISSION);
|
||||
int missionIndex = GameMain.GameSession.GetMissionIndex(mission);
|
||||
msg.Write((byte)(missionIndex == -1 ? 255: missionIndex));
|
||||
msg.Write((ushort)state);
|
||||
mission?.ServerWrite(msg);
|
||||
serverPeer.Send(msg, client.Connection, DeliveryMethod.Reliable);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,11 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
partial class RespawnManager : Entity, IServerSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// How much skills drop towards the job's default skill levels when respawning midround in the campaign
|
||||
/// </summary>
|
||||
const float SkillReductionOnCampaignMidroundRespawn = 0.5f;
|
||||
|
||||
private DateTime despawnTime;
|
||||
|
||||
private float shuttleEmptyTimer;
|
||||
@@ -361,9 +366,21 @@ namespace Barotrauma.Networking
|
||||
if (!bot && campaign != null)
|
||||
{
|
||||
var matchingData = campaign?.GetClientCharacterData(clients[i]);
|
||||
if (matchingData != null && !matchingData.HasSpawned)
|
||||
if (matchingData != null)
|
||||
{
|
||||
forceSpawnInMainSub = true;
|
||||
if (!matchingData.HasSpawned)
|
||||
{
|
||||
forceSpawnInMainSub = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (Skill skill in characterInfos[i].Job.Skills)
|
||||
{
|
||||
var skillPrefab = characterInfos[i].Job.Prefab.Skills.Find(s => skill.Prefab == s);
|
||||
if (skillPrefab == null) { continue; }
|
||||
skill.Level = MathHelper.Lerp(skill.Level, skillPrefab.LevelRange.X, SkillReductionOnCampaignMidroundRespawn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user