Store original character name in mind.

This commit is contained in:
Pieter-Jan Briers
2020-04-18 00:38:19 +02:00
parent 9d130d98d3
commit c4f147bab4
3 changed files with 10 additions and 3 deletions

View File

@@ -583,7 +583,10 @@ namespace Content.Server.GameTicking
var data = session.ContentData(); var data = session.ContentData();
data.WipeMind(); data.WipeMind();
data.Mind = new Mind(session.SessionId); data.Mind = new Mind(session.SessionId)
{
CharacterName = character.Name
};
if (jobId == null) if (jobId == null)
{ {

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Content.Server.GameObjects.Components.Mobs; using Content.Server.GameObjects.Components.Mobs;
using Content.Server.Players; using Content.Server.Players;
@@ -48,6 +48,9 @@ namespace Content.Server.Mobs
[ViewVariables] public IEntity CurrentEntity => VisitingEntity ?? OwnedEntity; [ViewVariables] public IEntity CurrentEntity => VisitingEntity ?? OwnedEntity;
[ViewVariables(VVAccess.ReadWrite)]
public string CharacterName { get; set; }
/// <summary> /// <summary>
/// The component currently owned by this mind. /// The component currently owned by this mind.
/// Can be null. /// Can be null.

View File

@@ -63,7 +63,8 @@ namespace Content.Server.Observer
var entityManager = IoCManager.Resolve<IEntityManager>(); var entityManager = IoCManager.Resolve<IEntityManager>();
var ghost = entityManager.SpawnEntity("MobObserver", position); var ghost = entityManager.SpawnEntity("MobObserver", position);
ghost.Name = name; ghost.Name = mind.CharacterName;
var ghostComponent = ghost.GetComponent<GhostComponent>(); var ghostComponent = ghost.GetComponent<GhostComponent>();
ghostComponent.CanReturnToBody = canReturn; ghostComponent.CanReturnToBody = canReturn;