Fix can't return to body bug (#4424)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user