Some more fixes
This commit is contained in:
@@ -547,7 +547,7 @@ namespace Content.Shared.Body.Components
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out SharedBodyPartComponent? part))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Value, out SharedBodyPartComponent? part))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ namespace Content.Shared.CombatMode
|
||||
|
||||
private void CombatModeActiveHandler(CombatModeSystemMessages.SetCombatModeActiveMessage ev, EntitySessionEventArgs eventArgs)
|
||||
{
|
||||
var entity = eventArgs.SenderSession?.AttachedEntity;
|
||||
var entity = eventArgs.SenderSession.AttachedEntityUid;
|
||||
|
||||
if (entity == null || !IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out SharedCombatModeComponent? combatModeComponent))
|
||||
if (entity == null || !EntityManager.TryGetComponent(entity.Value, out SharedCombatModeComponent? combatModeComponent))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -195,9 +195,10 @@ namespace Content.Shared.Examine
|
||||
|
||||
public static bool InRangeUnOccluded(AfterInteractEventArgs args, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
||||
{
|
||||
var originPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.User).MapPosition;
|
||||
EntityUid? tempQualifier = args.Target;
|
||||
var otherPos = (tempQualifier != null ? IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(tempQualifier) : null).MapPosition ?? args.ClickLocation.ToMap(IoCManager.Resolve<IEntityManager>());
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
var originPos = entityManager.GetComponent<TransformComponent>(args.User).MapPosition;
|
||||
var target = args.Target;
|
||||
var otherPos = (target != null ? entityManager.GetComponent<TransformComponent>(target.Value).MapPosition : args.ClickLocation.ToMap(entityManager));
|
||||
|
||||
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
|
||||
}
|
||||
|
||||
@@ -19,11 +19,11 @@ namespace Content.Shared.Hands
|
||||
SubscribeAllEvent<RequestSetHandEvent>(HandleSetHand);
|
||||
}
|
||||
|
||||
private static void HandleSetHand(RequestSetHandEvent msg, EntitySessionEventArgs eventArgs)
|
||||
private void HandleSetHand(RequestSetHandEvent msg, EntitySessionEventArgs eventArgs)
|
||||
{
|
||||
var entity = eventArgs.SenderSession.AttachedEntity;
|
||||
var entity = eventArgs.SenderSession.AttachedEntityUid;
|
||||
|
||||
if (entity == null || !IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out SharedHandsComponent? hands))
|
||||
if (entity == null || !EntityManager.TryGetComponent(entity.Value, out SharedHandsComponent? hands))
|
||||
return;
|
||||
|
||||
hands.ActiveHand = msg.HandName;
|
||||
|
||||
@@ -14,19 +14,6 @@ namespace Content.Shared.Interaction.Helpers
|
||||
private static SharedInteractionSystem SharedInteractionSystem => EntitySystem.Get<SharedInteractionSystem>();
|
||||
|
||||
#region Entities
|
||||
public static bool InRangeUnobstructed(
|
||||
this EntityUid origin,
|
||||
EntityUid other,
|
||||
float range = InteractionRange,
|
||||
CollisionGroup collisionMask = CollisionGroup.Impassable,
|
||||
Ignored? predicate = null,
|
||||
bool ignoreInsideBlocker = false,
|
||||
bool popup = false)
|
||||
{
|
||||
return SharedInteractionSystem.InRangeUnobstructed(origin, other, range, collisionMask, predicate,
|
||||
ignoreInsideBlocker, popup);
|
||||
}
|
||||
|
||||
public static bool InRangeUnobstructed(
|
||||
this EntityUid origin,
|
||||
EntityUid other,
|
||||
|
||||
@@ -46,19 +46,19 @@ namespace Content.Shared.Movement.EntitySystems
|
||||
if (!TryGetAttachedComponent<IMoverComponent>(session, out var moverComp))
|
||||
return;
|
||||
|
||||
var owner = session?.AttachedEntity;
|
||||
var owner = session?.AttachedEntityUid;
|
||||
|
||||
if (owner != null && session != null)
|
||||
{
|
||||
EntityManager.EventBus.RaiseLocalEvent(owner, new RelayMoveInputEvent(session));
|
||||
EntityManager.EventBus.RaiseLocalEvent(owner.Value, new RelayMoveInputEvent(session));
|
||||
|
||||
// For stuff like "Moving out of locker" or the likes
|
||||
if (owner.IsInContainer() &&
|
||||
(!IoCManager.Resolve<IEntityManager>().TryGetComponent(owner, out MobStateComponent? mobState) ||
|
||||
if (owner.Value.IsInContainer() &&
|
||||
(!EntityManager.TryGetComponent(owner.Value, out MobStateComponent? mobState) ||
|
||||
mobState.IsAlive()))
|
||||
{
|
||||
var relayMoveEvent = new RelayMovementEntityEvent(owner);
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(owner).ParentUid, relayMoveEvent);
|
||||
var relayMoveEvent = new RelayMovementEntityEvent(owner.Value);
|
||||
EntityManager.EventBus.RaiseLocalEvent(EntityManager.GetComponent<TransformComponent>(owner.Value).ParentUid, relayMoveEvent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,12 +80,12 @@ namespace Content.Shared.Movement.EntitySystems
|
||||
{
|
||||
component = default;
|
||||
|
||||
var ent = session?.AttachedEntity;
|
||||
var ent = session?.AttachedEntityUid;
|
||||
|
||||
if (ent == null || !IoCManager.Resolve<IEntityManager>().EntityExists(ent))
|
||||
if (ent == null || !IoCManager.Resolve<IEntityManager>().EntityExists(ent.Value))
|
||||
return false;
|
||||
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(ent, out T? comp))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(ent.Value, out T? comp))
|
||||
return false;
|
||||
|
||||
component = comp;
|
||||
|
||||
@@ -81,14 +81,14 @@ namespace Content.Shared.Pulling
|
||||
var pullableOldPullerE = pullable?.Puller;
|
||||
if (pullableOldPullerE != null)
|
||||
{
|
||||
ForceDisconnect(IoCManager.Resolve<IEntityManager>().GetComponent<SharedPullerComponent>(pullableOldPullerE), pullable!);
|
||||
ForceDisconnect(IoCManager.Resolve<IEntityManager>().GetComponent<SharedPullerComponent>(pullableOldPullerE.Value), pullable!);
|
||||
}
|
||||
|
||||
// Continue with the puller.
|
||||
var pullerOldPullableE = puller?.Pulling;
|
||||
if (pullerOldPullableE != null)
|
||||
{
|
||||
ForceDisconnect(puller!, IoCManager.Resolve<IEntityManager>().GetComponent<SharedPullableComponent>(pullerOldPullableE));
|
||||
ForceDisconnect(puller!, IoCManager.Resolve<IEntityManager>().GetComponent<SharedPullableComponent>(pullerOldPullableE.Value));
|
||||
}
|
||||
|
||||
// And now for the actual connection (if any).
|
||||
|
||||
@@ -38,8 +38,10 @@ namespace Content.Shared.Shuttles.Components
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetEntity(state.Console.Value, out var consoleEnt) ||
|
||||
!IoCManager.Resolve<IEntityManager>().TryGetComponent(consoleEnt, out SharedShuttleConsoleComponent? shuttleConsoleComponent))
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
if (!entityManager.TryGetEntity(state.Console.Value, out var consoleEnt) ||
|
||||
!entityManager.TryGetComponent(consoleEnt.Value, out SharedShuttleConsoleComponent? shuttleConsoleComponent))
|
||||
{
|
||||
Logger.Warning($"Unable to set Helmsman console to {state.Console.Value}");
|
||||
return;
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace Content.Shared.Slippery
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out PhysicsComponent? otherPhysics) ||
|
||||
if (!EntityManager.TryGetComponent(entity.Value, out PhysicsComponent? otherPhysics) ||
|
||||
!body.GetWorldAABB().Intersects(otherPhysics.GetWorldAABB()))
|
||||
{
|
||||
component.Colliding.Remove(uid);
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Shared.Spawning
|
||||
{
|
||||
public static class EntitySystemExtensions
|
||||
{
|
||||
public static IEntity? SpawnIfUnobstructed(
|
||||
public static EntityUid? SpawnIfUnobstructed(
|
||||
this IEntityManager entityManager,
|
||||
string? prototypeName,
|
||||
EntityCoordinates coordinates,
|
||||
@@ -24,7 +24,7 @@ namespace Content.Shared.Spawning
|
||||
return entityManager.SpawnIfUnobstructed(prototypeName, mapCoordinates, collisionLayer, box, physicsManager);
|
||||
}
|
||||
|
||||
public static IEntity? SpawnIfUnobstructed(
|
||||
public static EntityUid? SpawnIfUnobstructed(
|
||||
this IEntityManager entityManager,
|
||||
string? prototypeName,
|
||||
MapCoordinates coordinates,
|
||||
@@ -59,7 +59,7 @@ namespace Content.Shared.Spawning
|
||||
string? prototypeName,
|
||||
EntityCoordinates coordinates,
|
||||
CollisionGroup collisionLayer,
|
||||
[NotNullWhen(true)] out IEntity? entity,
|
||||
[NotNullWhen(true)] out EntityUid? entity,
|
||||
Box2? box = null,
|
||||
SharedPhysicsSystem? physicsManager = null)
|
||||
{
|
||||
@@ -73,7 +73,7 @@ namespace Content.Shared.Spawning
|
||||
string? prototypeName,
|
||||
MapCoordinates coordinates,
|
||||
CollisionGroup collisionLayer,
|
||||
[NotNullWhen(true)] out IEntity? entity,
|
||||
[NotNullWhen(true)] out EntityUid? entity,
|
||||
in Box2? box = null,
|
||||
SharedPhysicsSystem? physicsManager = null)
|
||||
{
|
||||
|
||||
@@ -79,8 +79,8 @@ namespace Content.Shared.SubFloor
|
||||
private void OnSubFloorTerminating(EntityUid uid, SubFloorHideComponent component, ComponentShutdown _)
|
||||
{
|
||||
// If component is being deleted don't need to worry about updating any component stuff because it won't matter very shortly.
|
||||
IEntity tempQualifier = EntityManager.GetEntity(uid);
|
||||
if ((!IoCManager.Resolve<IEntityManager>().EntityExists(tempQualifier) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(tempQualifier).EntityLifeStage) >= EntityLifeStage.Terminating) return;
|
||||
if (EntityManager.GetComponent<MetaDataComponent>(uid).EntityLifeStage >= EntityLifeStage.Terminating)
|
||||
return;
|
||||
|
||||
// Regardless of whether we're on a subfloor or not, unhide.
|
||||
UpdateEntity(uid, true);
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Content.Shared.Tabletop
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!IoCManager.Resolve<IEntityManager>().HasComponent<MapComponent>(parent) && !IoCManager.Resolve<IEntityManager>().HasComponent<IMapGridComponent>(parent))
|
||||
if (!EntityManager.HasComponent<MapComponent>(parent) && !EntityManager.HasComponent<IMapGridComponent>(parent))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user