Fix 3000 errors
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net.Security;
|
||||
using Content.Server.Administration;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Verbs;
|
||||
@@ -30,7 +29,7 @@ namespace Content.Server.Verbs.Commands
|
||||
var verbSystem = EntitySystem.Get<SharedVerbSystem>();
|
||||
|
||||
// get the 'player' entity (defaulting to command user, otherwise uses a uid)
|
||||
IEntity? playerEntity = null;
|
||||
EntityUid playerEntity = null;
|
||||
if (!int.TryParse(args[0], out var intPlayerUid))
|
||||
{
|
||||
if (args[0] == "self" && shell.Player?.AttachedEntity != null)
|
||||
@@ -45,7 +44,7 @@ namespace Content.Server.Verbs.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
entityManager.TryGetEntity(new EntityUid(intPlayerUid), out playerEntity);
|
||||
entityManager.EntityExists(new EntityUid(intPlayerUid));
|
||||
}
|
||||
|
||||
// gets the target entity
|
||||
@@ -62,7 +61,7 @@ namespace Content.Server.Verbs.Commands
|
||||
}
|
||||
|
||||
var entUid = new EntityUid(intUid);
|
||||
if (!entityManager.TryGetEntity(entUid, out var target))
|
||||
if (!entityManager.EntityExists(entUid)
|
||||
{
|
||||
shell.WriteError(Loc.GetString("invoke-verb-command-invalid-target-entity"));
|
||||
return;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Content.Server.Verbs.Commands
|
||||
var verbSystem = EntitySystem.Get<SharedVerbSystem>();
|
||||
|
||||
// get the 'player' entity (defaulting to command user, otherwise uses a uid)
|
||||
IEntity? playerEntity = null;
|
||||
EntityUid playerEntity = null;
|
||||
if (!int.TryParse(args[0], out var intPlayerUid))
|
||||
{
|
||||
if (args[0] == "self" && shell.Player?.AttachedEntity != null)
|
||||
@@ -42,7 +42,7 @@ namespace Content.Server.Verbs.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
entityManager.TryGetEntity(new EntityUid(intPlayerUid), out playerEntity);
|
||||
entityManager.EntityExists(new EntityUid(intPlayerUid));
|
||||
}
|
||||
|
||||
// gets the target entity
|
||||
@@ -59,7 +59,7 @@ namespace Content.Server.Verbs.Commands
|
||||
}
|
||||
|
||||
var entUid = new EntityUid(intUid);
|
||||
if (!entityManager.TryGetEntity(entUid, out var target))
|
||||
if (!entityManager.EntityExists(entUid)
|
||||
{
|
||||
shell.WriteError(Loc.GetString("list-verbs-command-invalid-target-entity"));
|
||||
return;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
|
||||
namespace Content.Server.Verbs
|
||||
@@ -30,7 +29,7 @@ namespace Content.Server.Verbs
|
||||
return;
|
||||
}
|
||||
|
||||
if (!EntityManager.TryGetEntity(args.Target, out var targetEntity))
|
||||
if (!EntityManager.EntityExists(args.Target)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -56,7 +55,7 @@ namespace Content.Server.Verbs
|
||||
{
|
||||
var player = (IPlayerSession) eventArgs.SenderSession;
|
||||
|
||||
if (!EntityManager.TryGetEntity(args.EntityUid, out var target))
|
||||
if (!EntityManager.EntityExists(args.EntityUid)
|
||||
{
|
||||
Logger.Warning($"{nameof(HandleVerbRequest)} called on a non-existent entity with id {args.EntityUid} by player {player}.");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user