Replace usages of MobObserver and AdminObserver with GameTicker consts (#21814)

This commit is contained in:
DrSmugleaf
2023-11-20 20:27:37 -08:00
committed by GitHub
parent 019d65add8
commit 641b490313
8 changed files with 17 additions and 12 deletions

View File

@@ -1,3 +1,4 @@
using Content.Server.GameTicking;
using Content.Shared.Follower;
using Robust.Shared.GameObjects;
using Robust.Shared.Log;
@@ -31,11 +32,11 @@ public sealed class FollowerSystemTest
var map = mapMan.CreateMap();
// Spawn an observer to be followed.
var followed = entMan.SpawnEntity("MobObserver", new MapCoordinates(0, 0, map));
var followed = entMan.SpawnEntity(GameTicker.ObserverPrototypeName, new MapCoordinates(0, 0, map));
logger.Info($"Spawned followed observer: {entMan.ToPrettyString(followed)}");
// Spawn an observer to follow another observer.
var follower = entMan.SpawnEntity("MobObserver", new MapCoordinates(0, 0, map));
var follower = entMan.SpawnEntity(GameTicker.ObserverPrototypeName, new MapCoordinates(0, 0, map));
logger.Info($"Spawned follower observer: {entMan.ToPrettyString(follower)}");
followerSystem.StartFollowingEntity(follower, followed);

View File

@@ -1,5 +1,5 @@
using System.Linq;
using Content.Server.Players;
using Content.Server.GameTicking;
using Content.Shared.Ghost;
using Content.Shared.Mind;
using Content.Shared.Players;
@@ -173,7 +173,7 @@ public sealed partial class MindTests
EntityUid ghost = default!;
await server.WaitAssertion(() =>
{
ghost = entMan.SpawnEntity("MobObserver", MapCoordinates.Nullspace);
ghost = entMan.SpawnEntity(GameTicker.ObserverPrototypeName, MapCoordinates.Nullspace);
mindSystem.Visit(mind.Id, ghost);
});
@@ -224,7 +224,7 @@ public sealed partial class MindTests
var ghost = await BecomeGhost(pair);
// Player is a normal ghost (not admin ghost).
Assert.That(entMan.GetComponent<MetaDataComponent>(player.AttachedEntity!.Value).EntityPrototype?.ID, Is.Not.EqualTo("AdminObserver"));
Assert.That(entMan.GetComponent<MetaDataComponent>(player.AttachedEntity!.Value).EntityPrototype?.ID, Is.Not.EqualTo(GameTicker.AdminObserverPrototypeName));
// Try to become an admin ghost
await server.WaitAssertion(() => serverConsole.ExecuteCommand(player, "aghost"));
@@ -235,7 +235,7 @@ public sealed partial class MindTests
{
Assert.That(player.AttachedEntity, Is.Not.EqualTo(ghost), "Player is still attached to the old ghost");
Assert.That(entMan.HasComponent<GhostComponent>(player.AttachedEntity), "Player did not become a new ghost");
Assert.That(entMan.GetComponent<MetaDataComponent>(player.AttachedEntity!.Value).EntityPrototype?.ID, Is.EqualTo("AdminObserver"));
Assert.That(entMan.GetComponent<MetaDataComponent>(player.AttachedEntity!.Value).EntityPrototype?.ID, Is.EqualTo(GameTicker.AdminObserverPrototypeName));
});
var mindId = player.ContentData()?.Mind;

View File

@@ -1,7 +1,7 @@
using System.Linq;
using Content.IntegrationTests.Pair;
using Content.Server.GameTicking;
using Content.Server.Mind;
using Content.Server.Players;
using Content.Shared.Ghost;
using Content.Shared.Mind;
using Content.Shared.Players;
@@ -78,7 +78,7 @@ public sealed partial class MindTests
await pair.Server.WaitAssertion(() =>
{
var oldUid = player.AttachedEntity;
ghostUid = entMan.SpawnEntity("MobObserver", MapCoordinates.Nullspace);
ghostUid = entMan.SpawnEntity(GameTicker.ObserverPrototypeName, MapCoordinates.Nullspace);
mindId = mindSys.GetMind(player.UserId)!.Value;
Assert.That(mindId, Is.Not.EqualTo(default(EntityUid)));
mind = entMan.GetComponent<MindComponent>(mindId);