mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-06-09 10:06:43 +02:00
d42adbf05d
* Pass 1. * i'm FREE * Prevent hangups. * okay fine here's an attribute for settings, will polish later and prolly remove the overridable thing. * sigh. * fix singular trigger bug so LatheTest doesn't flake. * Remove SystemAttribute usage. * Poke * I used the shotgun. You know why? Cause the shot gun doesn’t miss, and unlike the shitty hybrid taser it stops a criminal in their tracks in two hits. Bang, bang, and they’re fucking done. I use four shots just to make damn sure. Because, once again, I’m not there to coddle a buncha criminal scum sucking f------, I’m there to 1) Survive the fucking round. 2) Guard the armory. So you can absolutely get fucked. If I get unbanned, which I won’t, you can guarantee I will continue to use the shotgun to apprehend criminals. Because it’s quick, clean and effective as fuck. Why in the seven hells would I fuck around with the disabler shots, which take half a clip just to bring someone down, or with the tazer bolts which are slow as balls, impossible to aim and do about next to jack shit, fuck all. The shotgun is the superior law enforcement weapon. Because it stops crime. And it stops crime by reducing the number of criminals roaming the fucking halls. * Change the faulty store test into two tests, one of which is ignored for failing.
50 lines
1.8 KiB
C#
50 lines
1.8 KiB
C#
using Content.IntegrationTests.Fixtures;
|
|
using Content.Server.GameTicking;
|
|
using Content.Shared.Follower;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Log;
|
|
using Robust.Shared.Map;
|
|
|
|
namespace Content.IntegrationTests.Tests;
|
|
|
|
[TestFixture, TestOf(typeof(FollowerSystem))]
|
|
public sealed class FollowerSystemTest : GameTest
|
|
{
|
|
/// <summary>
|
|
/// This test ensures that deleting a map while an entity follows another doesn't throw any exceptions.
|
|
/// </summary>
|
|
[Test]
|
|
public async Task FollowerMapDeleteTest()
|
|
{
|
|
var pair = Pair;
|
|
var server = pair.Server;
|
|
|
|
var entMan = server.ResolveDependency<IEntityManager>();
|
|
var mapMan = server.ResolveDependency<IMapManager>();
|
|
var sysMan = server.ResolveDependency<IEntitySystemManager>();
|
|
var logMan = server.ResolveDependency<ILogManager>();
|
|
var mapSys = server.System<SharedMapSystem>();
|
|
var logger = logMan.RootSawmill;
|
|
|
|
await server.WaitPost(() =>
|
|
{
|
|
var followerSystem = sysMan.GetEntitySystem<FollowerSystem>();
|
|
|
|
// Create a map to spawn the observers on.
|
|
mapSys.CreateMap(out var map);
|
|
|
|
// Spawn an observer to be followed.
|
|
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(GameTicker.ObserverPrototypeName, new MapCoordinates(0, 0, map));
|
|
logger.Info($"Spawned follower observer: {entMan.ToPrettyString(follower)}");
|
|
|
|
followerSystem.StartFollowingEntity(follower, followed);
|
|
|
|
entMan.DeleteEntity(mapSys.GetMap(map));
|
|
});
|
|
}
|
|
}
|