using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Random;
+using Robust.Shared.Prototypes;
namespace Content.Server.Respawn;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly TurfSystem _turf = default!;
[Dependency] private readonly IChatManager _chat = default!;
+ [Dependency] private readonly IPrototypeManager _proto = default!;
public override void Initialize()
{
if (!TryComp<MapGridComponent>(entityGridUid, out var grid) || MetaData(entityGridUid.Value).EntityLifeStage >= EntityLifeStage.Terminating)
return;
+ //Invalid prototype
+ if (!_proto.HasIndex(component.Prototype))
+ return;
+
if (TryFindRandomTile(entityGridUid.Value, entityMapUid.Value, 10, out var coords))
Respawn(uid, component.Prototype, coords);