Fix can't return to body bug (#4424)

This commit is contained in:
mirrorcult
2021-08-06 00:02:36 -07:00
committed by GitHub
parent db65ed5536
commit 09f5ec5cb8
6 changed files with 16 additions and 25 deletions

View File

@@ -13,6 +13,7 @@ using Content.Server.Roles;
using Content.Server.Spawners.Components;
using Content.Server.Speech.Components;
using Content.Shared.GameTicking;
using Content.Shared.Ghost;
using Content.Shared.Inventory;
using Content.Shared.Preferences;
using Content.Shared.Roles;
@@ -144,7 +145,8 @@ namespace Content.Server.GameTicking
var mob = SpawnObserverMob();
mob.Name = name;
mob.GetComponent<GhostComponent>().CanReturnToBody = false;
var ghost = mob.GetComponent<GhostComponent>();
EntitySystem.Get<SharedGhostSystem>().SetCanReturnToBody(ghost, false);
data.Mind.TransferTo(mob);
_playersInLobby[player] = LobbyPlayerStatus.Observer;

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using Content.Server.Ghost.Components;
using Content.Shared.Damage;
using Content.Shared.Damage.Components;
using Content.Shared.Ghost;
using Content.Shared.MobState;
using Content.Shared.Preferences;
using Robust.Server.Player;
@@ -75,7 +76,7 @@ namespace Content.Server.GameTicking.Presets
ghost.Name = mind.CharacterName ?? string.Empty;
var ghostComponent = ghost.GetComponent<GhostComponent>();
ghostComponent.CanReturnToBody = canReturn;
EntitySystem.Get<SharedGhostSystem>().SetCanReturnToBody(ghostComponent, canReturn);
if (canReturn)
mind.Visit(ghost);