Remove redundant IComponent casts

This commit is contained in:
metalgearsloth
2021-12-07 21:54:00 +11:00
parent 8d4799e611
commit 373b5988d7
29 changed files with 53 additions and 53 deletions

View File

@@ -119,7 +119,7 @@ namespace Content.Client.Inventory
} }
} }
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner); EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(Owner);
} }
private void _setSlot(Slots slot, EntityUid entity) private void _setSlot(Slots slot, EntityUid entity)

View File

@@ -22,7 +22,7 @@ namespace Content.Client.Nutrition.Components
_currentHungerThreshold = hunger.CurrentThreshold; _currentHungerThreshold = hunger.CurrentThreshold;
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner); EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(Owner);
} }
} }
} }

View File

@@ -22,7 +22,7 @@ namespace Content.Client.Nutrition.Components
_currentThirstThreshold = thirst.CurrentThreshold; _currentThirstThreshold = thirst.CurrentThreshold;
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner); EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(Owner);
} }
} }
} }

View File

@@ -108,9 +108,9 @@ namespace Content.Server.Access.Components
private void HandleIdButton(EntityUid user, ItemSlot slot) private void HandleIdButton(EntityUid user, ItemSlot slot)
{ {
if (slot.HasItem) if (slot.HasItem)
EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(((IComponent) this).Owner, slot, user); EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(Owner, slot, user);
else else
EntitySystem.Get<ItemSlotsSystem>().TryInsertFromHand(((IComponent) this).Owner, slot, user); EntitySystem.Get<ItemSlotsSystem>().TryInsertFromHand(Owner, slot, user);
} }
public void UpdateUserInterface() public void UpdateUserInterface()

View File

@@ -131,7 +131,7 @@ namespace Content.Server.Arcade.Components
if (obj.Session != _player) break; if (obj.Session != _player) break;
// TODO: Should this check if the Owner can interact...? // TODO: Should this check if the Owner can interact...?
if (!EntitySystem.Get<ActionBlockerSystem>().CanInteract(((IComponent) this).Owner)) if (!EntitySystem.Get<ActionBlockerSystem>().CanInteract(Owner))
{ {
DeactivePlayer(obj.Session); DeactivePlayer(obj.Session);
break; break;

View File

@@ -269,7 +269,7 @@ namespace Content.Server.Atmos.Components
range = MaxExplosionRange; range = MaxExplosionRange;
} }
EntitySystem.Get<ExplosionSystem>().SpawnExplosion(((IComponent) this).Owner, (int) (range * 0.25f), (int) (range * 0.5f), (int) (range * 1.5f), 1); EntitySystem.Get<ExplosionSystem>().SpawnExplosion(Owner, (int) (range * 0.25f), (int) (range * 0.5f), (int) (range * 1.5f), 1);
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(Owner); IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(Owner);
return; return;

View File

@@ -562,10 +562,10 @@ namespace Content.Server.Botany.Components
else else
{ {
var amt = FixedPoint2.New(1); var amt = FixedPoint2.New(1);
foreach (var reagent in solutionSystem.RemoveEachReagent(((IComponent) this).Owner, solution, amt)) foreach (var reagent in solutionSystem.RemoveEachReagent(Owner, solution, amt))
{ {
var reagentProto = _prototypeManager.Index<ReagentPrototype>(reagent); var reagentProto = _prototypeManager.Index<ReagentPrototype>(reagent);
reagentProto.ReactionPlant(((IComponent) this).Owner, new Solution.ReagentQuantity(reagent, amt), solution); reagentProto.ReactionPlant(Owner, new Solution.ReagentQuantity(reagent, amt), solution);
} }
} }

View File

@@ -141,7 +141,7 @@ namespace Content.Server.Cargo.Components
// attempt to attach the label // attempt to attach the label
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(product, out PaperLabelComponent label)) if (IoCManager.Resolve<IEntityManager>().TryGetComponent(product, out PaperLabelComponent label))
{ {
EntitySystem.Get<ItemSlotsSystem>().TryInsert(((IComponent) this).Owner, label.LabelSlot, printed); EntitySystem.Get<ItemSlotsSystem>().TryInsert(Owner, label.LabelSlot, printed);
} }
} }

View File

@@ -121,7 +121,7 @@ namespace Content.Server.Chemistry.Components
switch (msg.Action) switch (msg.Action)
{ {
case UiAction.Eject: case UiAction.Eject:
EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(((IComponent) this).Owner, BeakerSlot, player); EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(Owner, BeakerSlot, player);
break; break;
case UiAction.ChemButton: case UiAction.ChemButton:
TransferReagent(msg.Id, msg.Amount, msg.IsBuffer); TransferReagent(msg.Id, msg.Amount, msg.IsBuffer);

View File

@@ -149,7 +149,7 @@ namespace Content.Server.Chemistry.Components
switch (msg.Button) switch (msg.Button)
{ {
case UiButton.Eject: case UiButton.Eject:
EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(((IComponent) this).Owner, BeakerSlot, obj.Session.AttachedEntity); EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(Owner, BeakerSlot, obj.Session.AttachedEntity);
break; break;
case UiButton.Clear: case UiButton.Clear:
TryClear(); TryClear();

View File

@@ -85,7 +85,7 @@ namespace Content.Server.Climbing.Components
Body.ApplyLinearImpulse((to - from).Normalized * velocity * Body.Mass * 5); Body.ApplyLinearImpulse((to - from).Normalized * velocity * Body.Mass * 5);
OwnerIsTransitioning = true; OwnerIsTransitioning = true;
EntitySystem.Get<ClimbSystem>().UnsetTransitionBoolAfterBufferTime(((IComponent) this).Owner, this); EntitySystem.Get<ClimbSystem>().UnsetTransitionBoolAfterBufferTime(Owner, this);
} }
public void Update() public void Update()

View File

@@ -124,7 +124,7 @@ namespace Content.Server.Construction.Components
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<ConstructionComponent?>(Owner, out var construction)) if (IoCManager.Resolve<IEntityManager>().TryGetComponent<ConstructionComponent?>(Owner, out var construction))
{ {
// Attempt to set pathfinding to the machine node... // Attempt to set pathfinding to the machine node...
EntitySystem.Get<ConstructionSystem>().SetPathfindingTarget(((IComponent) this).Owner, "machine", construction); EntitySystem.Get<ConstructionSystem>().SetPathfindingTarget(Owner, "machine", construction);
} }
} }
@@ -271,7 +271,7 @@ namespace Content.Server.Construction.Components
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out ConstructionComponent? construction)) if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out ConstructionComponent? construction))
{ {
// So prying the components off works correctly. // So prying the components off works correctly.
EntitySystem.Get<ConstructionSystem>().ResetEdge(((IComponent) this).Owner, construction); EntitySystem.Get<ConstructionSystem>().ResetEdge(Owner, construction);
} }
return true; return true;

View File

@@ -32,7 +32,7 @@ namespace Content.Server.Disposal.Tube.Components
EntitySystem.Get<AtmosphereSystem>().Merge(holderComponent.Air, from.Air); EntitySystem.Get<AtmosphereSystem>().Merge(holderComponent.Air, from.Air);
from.Air.Clear(); from.Air.Clear();
return EntitySystem.Get<DisposableSystem>().EnterTube(((IComponent) holderComponent).Owner, ((IComponent) this).Owner, holderComponent, null, this); return EntitySystem.Get<DisposableSystem>().EnterTube(((IComponent) holderComponent).Owner, Owner, holderComponent, null, this);
} }
protected override Direction[] ConnectableDirections() protected override Direction[] ConnectableDirections()

View File

@@ -48,7 +48,7 @@ namespace Content.Server.Ghost.Roles.Components
mob.EnsureComponent<MindComponent>(); mob.EnsureComponent<MindComponent>();
var ghostRoleSystem = EntitySystem.Get<GhostRoleSystem>(); var ghostRoleSystem = EntitySystem.Get<GhostRoleSystem>();
ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, ((IComponent) this).Owner, mob, this); ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, Owner, mob, this);
if (++_currentTakeovers < _availableTakeovers) if (++_currentTakeovers < _availableTakeovers)
return true; return true;

View File

@@ -30,10 +30,10 @@ namespace Content.Server.Ghost.Roles.Components
return false; return false;
if (MakeSentient) if (MakeSentient)
MakeSentientCommand.MakeSentient(((IComponent) this).Owner, IoCManager.Resolve<IEntityManager>()); MakeSentientCommand.MakeSentient(Owner, IoCManager.Resolve<IEntityManager>());
var ghostRoleSystem = EntitySystem.Get<GhostRoleSystem>(); var ghostRoleSystem = EntitySystem.Get<GhostRoleSystem>();
ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, ((IComponent) this).Owner, ((IComponent) this).Owner, this); ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, Owner, Owner, this);
ghostRoleSystem.UnregisterGhostRole(this); ghostRoleSystem.UnregisterGhostRole(this);

View File

@@ -201,7 +201,7 @@ namespace Content.Server.Inventory.Components
var pass = false; var pass = false;
reason = null; reason = null;
if (mobCheck && !EntitySystem.Get<ActionBlockerSystem>().CanEquip(((IComponent) this).Owner)) if (mobCheck && !EntitySystem.Get<ActionBlockerSystem>().CanEquip(Owner))
{ {
reason = Loc.GetString("inventory-component-can-equip-cannot"); reason = Loc.GetString("inventory-component-can-equip-cannot");
return false; return false;
@@ -288,7 +288,7 @@ namespace Content.Server.Inventory.Components
private void UpdateMovementSpeed() private void UpdateMovementSpeed()
{ {
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner); EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(Owner);
} }
public void ForceUnequip(Slots slot) public void ForceUnequip(Slots slot)
@@ -323,7 +323,7 @@ namespace Content.Server.Inventory.Components
/// </returns> /// </returns>
public bool CanUnequip(Slots slot, bool mobCheck = true) public bool CanUnequip(Slots slot, bool mobCheck = true)
{ {
if (mobCheck && !EntitySystem.Get<ActionBlockerSystem>().CanUnequip(((IComponent) this).Owner)) if (mobCheck && !EntitySystem.Get<ActionBlockerSystem>().CanUnequip(Owner))
return false; return false;
var inventorySlot = _slotContainers[slot]; var inventorySlot = _slotContainers[slot];

View File

@@ -90,7 +90,7 @@ namespace Content.Server.Nutrition.Components
if (_lastHungerThreshold == HungerThreshold.Starving && _currentHungerThreshold != HungerThreshold.Dead && if (_lastHungerThreshold == HungerThreshold.Starving && _currentHungerThreshold != HungerThreshold.Dead &&
IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out MovementSpeedModifierComponent? movementSlowdownComponent)) IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out MovementSpeedModifierComponent? movementSlowdownComponent))
{ {
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner); EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(Owner);
} }
// Update UI // Update UI
@@ -126,7 +126,7 @@ namespace Content.Server.Nutrition.Components
case HungerThreshold.Starving: case HungerThreshold.Starving:
// TODO: If something else bumps this could cause mega-speed. // TODO: If something else bumps this could cause mega-speed.
// If some form of speed update system if multiple things are touching it use that. // If some form of speed update system if multiple things are touching it use that.
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner); EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(Owner);
_lastHungerThreshold = _currentHungerThreshold; _lastHungerThreshold = _currentHungerThreshold;
_actualDecayRate = _baseDecayRate * 0.6f; _actualDecayRate = _baseDecayRate * 0.6f;
return; return;

View File

@@ -89,7 +89,7 @@ namespace Content.Server.Nutrition.Components
if (_lastThirstThreshold == ThirstThreshold.Parched && _currentThirstThreshold != ThirstThreshold.Dead && if (_lastThirstThreshold == ThirstThreshold.Parched && _currentThirstThreshold != ThirstThreshold.Dead &&
IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out MovementSpeedModifierComponent? movementSlowdownComponent)) IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out MovementSpeedModifierComponent? movementSlowdownComponent))
{ {
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner); EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(Owner);
} }
// Update UI // Update UI
@@ -123,7 +123,7 @@ namespace Content.Server.Nutrition.Components
return; return;
case ThirstThreshold.Parched: case ThirstThreshold.Parched:
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner); EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(Owner);
_lastThirstThreshold = _currentThirstThreshold; _lastThirstThreshold = _currentThirstThreshold;
_actualDecayRate = _baseDecayRate * 0.6f; _actualDecayRate = _baseDecayRate * 0.6f;
return; return;

View File

@@ -73,7 +73,7 @@ namespace Content.Server.PowerCell.Components
var light = (int) Math.Ceiling(Math.Sqrt(CurrentCharge) / 30); var light = (int) Math.Ceiling(Math.Sqrt(CurrentCharge) / 30);
CurrentCharge = 0; CurrentCharge = 0;
EntitySystem.Get<ExplosionSystem>().SpawnExplosion(((IComponent) this).Owner, 0, heavy, light, light*2); EntitySystem.Get<ExplosionSystem>().SpawnExplosion(Owner, 0, heavy, light, light*2);
IoCManager.Resolve<IEntityManager>().DeleteEntity(Owner); IoCManager.Resolve<IEntityManager>().DeleteEntity(Owner);
} }

View File

@@ -33,11 +33,11 @@ namespace Content.Server.Shuttles.Components
if (!_enabled) if (!_enabled)
{ {
system.DisableThruster(((IComponent) this).Owner, this); system.DisableThruster(Owner, this);
} }
else if (system.CanEnable(((IComponent) this).Owner, this)) else if (system.CanEnable(Owner, this))
{ {
system.EnableThruster(((IComponent) this).Owner, this); system.EnableThruster(Owner, this);
} }
} }
} }

View File

@@ -221,7 +221,7 @@ namespace Content.Server.Storage.Components
var targetIsItem = IoCManager.Resolve<IEntityManager>().HasComponent<SharedItemComponent>(entity); var targetIsItem = IoCManager.Resolve<IEntityManager>().HasComponent<SharedItemComponent>(entity);
var targetIsMob = IoCManager.Resolve<IEntityManager>().HasComponent<SharedBodyComponent>(entity); var targetIsMob = IoCManager.Resolve<IEntityManager>().HasComponent<SharedBodyComponent>(entity);
var storageIsItem = IoCManager.Resolve<IEntityManager>().HasComponent<SharedItemComponent>(((IComponent) this).Owner); var storageIsItem = IoCManager.Resolve<IEntityManager>().HasComponent<SharedItemComponent>(Owner);
var allowedToEat = false; var allowedToEat = false;

View File

@@ -94,7 +94,7 @@ namespace Content.Server.Storage.Components
private void UpdateStorageVisualization() private void UpdateStorageVisualization()
{ {
if (!_entityManager.TryGetComponent(((IComponent) this).Owner, out AppearanceComponent appearance)) if (!_entityManager.TryGetComponent(Owner, out AppearanceComponent appearance))
return; return;
bool open = SubscribedSessions.Count != 0; bool open = SubscribedSessions.Count != 0;
@@ -102,7 +102,7 @@ namespace Content.Server.Storage.Components
appearance.SetData(StorageVisuals.Open, open); appearance.SetData(StorageVisuals.Open, open);
appearance.SetData(SharedBagOpenVisuals.BagState, open ? SharedBagState.Open : SharedBagState.Closed); appearance.SetData(SharedBagOpenVisuals.BagState, open ? SharedBagState.Open : SharedBagState.Closed);
if (_entityManager.HasComponent<ItemCounterComponent>(((IComponent) this).Owner)) if (_entityManager.HasComponent<ItemCounterComponent>(Owner))
appearance.SetData(StackVisuals.Hide, !open); appearance.SetData(StackVisuals.Hide, !open);
} }
@@ -402,7 +402,7 @@ namespace Content.Server.Storage.Components
{ {
if (_entityManager.TryGetComponent(entity, out ServerStorageComponent storageComponent)) if (_entityManager.TryGetComponent(entity, out ServerStorageComponent storageComponent))
{ {
DebugTools.Assert(storageComponent != this, $"Storage component contains itself!? Entity: {((IComponent) this).Owner}"); DebugTools.Assert(storageComponent != this, $"Storage component contains itself!? Entity: {Owner}");
storageComponent.UnsubscribeSession(session); storageComponent.UnsubscribeSession(session);
} }

View File

@@ -365,7 +365,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
_entities.GetComponent<TransformComponent>(projectile).WorldRotation = projectileAngle + MathHelper.PiOver2; _entities.GetComponent<TransformComponent>(projectile).WorldRotation = projectileAngle + MathHelper.PiOver2;
} }
_entities.EventBus.RaiseLocalEvent(((IComponent) this).Owner, new GunShotEvent(firedProjectiles)); _entities.EventBus.RaiseLocalEvent(Owner, new GunShotEvent(firedProjectiles));
_entities.EventBus.RaiseLocalEvent(ammo, new AmmoShotEvent(firedProjectiles)); _entities.EventBus.RaiseLocalEvent(ammo, new AmmoShotEvent(firedProjectiles));
} }

View File

@@ -86,7 +86,7 @@ namespace Content.Shared.Actions.Components
if (_holderActionsComponent == null) return; if (_holderActionsComponent == null) return;
foreach (var (actionType, state) in _actions) foreach (var (actionType, state) in _actions)
{ {
_holderActionsComponent.GrantOrUpdateItemAction(actionType, ((IComponent) this).Owner, state); _holderActionsComponent.GrantOrUpdateItemAction(actionType, Owner, state);
} }
} }
@@ -95,7 +95,7 @@ namespace Content.Shared.Actions.Components
if (_holderActionsComponent == null) return; if (_holderActionsComponent == null) return;
foreach (var (actionType, state) in _actions) foreach (var (actionType, state) in _actions)
{ {
_holderActionsComponent.RevokeItemAction(actionType, ((IComponent) this).Owner); _holderActionsComponent.RevokeItemAction(actionType, Owner);
} }
} }
@@ -152,7 +152,7 @@ namespace Content.Shared.Actions.Components
if (!dirty) return; if (!dirty) return;
_actions[actionType] = actionState; _actions[actionType] = actionState;
_holderActionsComponent?.GrantOrUpdateItemAction(actionType, ((IComponent) this).Owner, actionState); _holderActionsComponent?.GrantOrUpdateItemAction(actionType, Owner, actionState);
} }
/// <summary> /// <summary>

View File

@@ -146,7 +146,7 @@ namespace Content.Shared.Body.Components
var argsAdded = new BodyPartAddedEventArgs(slot.Id, part); var argsAdded = new BodyPartAddedEventArgs(slot.Id, part);
EntitySystem.Get<SharedHumanoidAppearanceSystem>().BodyPartAdded(((IComponent) this).Owner, argsAdded); EntitySystem.Get<SharedHumanoidAppearanceSystem>().BodyPartAdded(Owner, argsAdded);
foreach (var component in IoCManager.Resolve<IEntityManager>().GetComponents<IBodyPartAdded>(Owner).ToArray()) foreach (var component in IoCManager.Resolve<IEntityManager>().GetComponents<IBodyPartAdded>(Owner).ToArray())
{ {
component.BodyPartAdded(argsAdded); component.BodyPartAdded(argsAdded);
@@ -174,7 +174,7 @@ namespace Content.Shared.Body.Components
var args = new BodyPartRemovedEventArgs(slot.Id, part); var args = new BodyPartRemovedEventArgs(slot.Id, part);
EntitySystem.Get<SharedHumanoidAppearanceSystem>().BodyPartRemoved(((IComponent) this).Owner, args); EntitySystem.Get<SharedHumanoidAppearanceSystem>().BodyPartRemoved(Owner, args);
foreach (var component in IoCManager.Resolve<IEntityManager>().GetComponents<IBodyPartRemoved>(Owner)) foreach (var component in IoCManager.Resolve<IEntityManager>().GetComponents<IBodyPartRemoved>(Owner))
{ {
component.BodyPartRemoved(args); component.BodyPartRemoved(args);
@@ -184,7 +184,7 @@ namespace Content.Shared.Body.Components
if (part.PartType == BodyPartType.Leg && if (part.PartType == BodyPartType.Leg &&
GetPartsOfType(BodyPartType.Leg).ToArray().Length == 0) GetPartsOfType(BodyPartType.Leg).ToArray().Length == 0)
{ {
EntitySystem.Get<StandingStateSystem>().Down(((IComponent) this).Owner); EntitySystem.Get<StandingStateSystem>().Down(Owner);
} }
if (part.IsVital && SlotParts.Count(x => x.Value.PartType == part.PartType) == 0) if (part.IsVital && SlotParts.Count(x => x.Value.PartType == part.PartType) == 0)

View File

@@ -37,11 +37,11 @@ namespace Content.Shared.Body.Components
{ {
if (old.Body == null) if (old.Body == null)
{ {
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new RemovedFromPartEvent(old)); IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(Owner, new RemovedFromPartEvent(old));
} }
else else
{ {
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new RemovedFromPartInBodyEvent(old.Body, old)); IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(Owner, new RemovedFromPartInBodyEvent(old.Body, old));
} }
} }
@@ -49,11 +49,11 @@ namespace Content.Shared.Body.Components
{ {
if (value.Body == null) if (value.Body == null)
{ {
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new AddedToPartEvent(value)); IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(Owner, new AddedToPartEvent(value));
} }
else else
{ {
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new AddedToPartInBodyEvent(value.Body, value)); IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(Owner, new AddedToPartInBodyEvent(value.Body, value));
} }
} }
} }

View File

@@ -95,7 +95,7 @@ namespace Content.Shared.Damage
damage.DamageDict.Add(typeID, damageValue); damage.DamageDict.Add(typeID, damageValue);
} }
var actual = EntitySystem.Get<DamageableSystem>().TryChangeDamage(((IComponent) this).Owner, damage); var actual = EntitySystem.Get<DamageableSystem>().TryChangeDamage(Owner, damage);
// should logging be disabled during rad storms? a lot of entities are going to be damaged. // should logging be disabled during rad storms? a lot of entities are going to be damaged.
if (actual != null && !actual.Empty) if (actual != null && !actual.Empty)
@@ -120,7 +120,7 @@ namespace Content.Shared.Damage
damage.DamageDict.Add(typeID, damageValue); damage.DamageDict.Add(typeID, damageValue);
} }
var actual = EntitySystem.Get<DamageableSystem>().TryChangeDamage(((IComponent) this).Owner, damage); var actual = EntitySystem.Get<DamageableSystem>().TryChangeDamage(Owner, damage);
// will logging handle nukes? // will logging handle nukes?
if (actual != null && !actual.Empty) if (actual != null && !actual.Empty)

View File

@@ -433,7 +433,7 @@ namespace Content.Shared.Hands.Components
/// </summary> /// </summary>
private bool PlayerCanDrop() private bool PlayerCanDrop()
{ {
if (!IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ActionBlockerSystem>().CanDrop(((IComponent) this).Owner)) if (!IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ActionBlockerSystem>().CanDrop(Owner))
return false; return false;
return true; return true;

View File

@@ -291,7 +291,7 @@ namespace Content.Shared.MobState.Components
{ {
if (!current.HasValue) if (!current.HasValue)
{ {
old?.ExitState(((IComponent) this).Owner, IoCManager.Resolve<IEntityManager>()); old?.ExitState(Owner, IoCManager.Resolve<IEntityManager>());
return; return;
} }
@@ -301,16 +301,16 @@ namespace Content.Shared.MobState.Components
if (state == old) if (state == old)
{ {
state.UpdateState(((IComponent) this).Owner, threshold, IoCManager.Resolve<IEntityManager>()); state.UpdateState(Owner, threshold, IoCManager.Resolve<IEntityManager>());
return; return;
} }
old?.ExitState(((IComponent) this).Owner, IoCManager.Resolve<IEntityManager>()); old?.ExitState(Owner, IoCManager.Resolve<IEntityManager>());
CurrentState = state; CurrentState = state;
state.EnterState(((IComponent) this).Owner, IoCManager.Resolve<IEntityManager>()); state.EnterState(Owner, IoCManager.Resolve<IEntityManager>());
state.UpdateState(((IComponent) this).Owner, threshold, IoCManager.Resolve<IEntityManager>()); state.UpdateState(Owner, threshold, IoCManager.Resolve<IEntityManager>());
var message = new MobStateChangedMessage(this, old, state); var message = new MobStateChangedMessage(this, old, state);
#pragma warning disable 618 #pragma warning disable 618