Merge remote-tracking branch 'upstream/master' into develop
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Barotrauma.Networking;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
@@ -26,6 +27,27 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
if (GameMain.Server is { ServerSettings.RespawnMode: RespawnMode.Permadeath } &&
|
||||
GameMain.GameSession?.Campaign is MultiPlayerCampaign mpCampaign &&
|
||||
causeOfDeath != CauseOfDeathType.Disconnected)
|
||||
{
|
||||
Client ownerClient = GameMain.Server.ConnectedClients.FirstOrDefault(c => c.Character == this);
|
||||
if (ownerClient != null)
|
||||
{
|
||||
ownerClient.SpectateOnly = true;
|
||||
CharacterCampaignData matchingData = mpCampaign.GetClientCharacterData(ownerClient);
|
||||
if (matchingData != null)
|
||||
{
|
||||
matchingData.ApplyPermadeath();
|
||||
|
||||
if (GameMain.Server is { ServerSettings.IronmanMode: true })
|
||||
{
|
||||
mpCampaign.SaveSingleCharacter(matchingData);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (HasAbilityFlag(AbilityFlags.RetainExperienceForNewCharacter))
|
||||
{
|
||||
var ownerClient = GameMain.Server.ConnectedClients.Find(c => c.Character == this);
|
||||
|
||||
@@ -96,6 +96,7 @@ namespace Barotrauma
|
||||
|
||||
msg.WriteInt32(ExperiencePoints);
|
||||
msg.WriteRangedInteger(AdditionalTalentPoints, 0, MaxAdditionalTalentPoints);
|
||||
msg.WriteBoolean(PermanentlyDead);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user