Delete ghost when respawning (#3519)
* Delete ghost when respawning Fix session.AttachedEntity not being set to null when mind is wiped Fix MindComponent not getting disconnected when Mind is wiped Rename OwnedMob to OwnedComponent * Update Content.Server/GameTicking/GameTicker.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -409,7 +409,10 @@ namespace Content.Server.GameTicking
|
||||
|
||||
public void Respawn(IPlayerSession targetPlayer)
|
||||
{
|
||||
targetPlayer.AttachedEntity.TryGetComponent<GhostComponent>(out var ghost);
|
||||
targetPlayer.ContentData()?.WipeMind();
|
||||
if (ghost?.Deleted == false)
|
||||
ghost.Owner.Delete();
|
||||
|
||||
if (LobbyEnabled)
|
||||
_playerJoinLobby(targetPlayer);
|
||||
|
||||
Reference in New Issue
Block a user