diff --git a/Content.Client/Inventory/ClientInventoryComponent.cs b/Content.Client/Inventory/ClientInventoryComponent.cs index 143d0762f9..3c842348d4 100644 --- a/Content.Client/Inventory/ClientInventoryComponent.cs +++ b/Content.Client/Inventory/ClientInventoryComponent.cs @@ -119,7 +119,7 @@ namespace Content.Client.Inventory } } - EntitySystem.Get().RefreshMovementSpeedModifiers(((IComponent) this).Owner); + EntitySystem.Get().RefreshMovementSpeedModifiers(Owner); } private void _setSlot(Slots slot, EntityUid entity) diff --git a/Content.Client/Nutrition/Components/HungerComponent.cs b/Content.Client/Nutrition/Components/HungerComponent.cs index e865a6ae12..5ddf6e2b27 100644 --- a/Content.Client/Nutrition/Components/HungerComponent.cs +++ b/Content.Client/Nutrition/Components/HungerComponent.cs @@ -22,7 +22,7 @@ namespace Content.Client.Nutrition.Components _currentHungerThreshold = hunger.CurrentThreshold; - EntitySystem.Get().RefreshMovementSpeedModifiers(((IComponent) this).Owner); + EntitySystem.Get().RefreshMovementSpeedModifiers(Owner); } } } diff --git a/Content.Client/Nutrition/Components/ThirstComponent.cs b/Content.Client/Nutrition/Components/ThirstComponent.cs index 1493f94024..5b1caa099b 100644 --- a/Content.Client/Nutrition/Components/ThirstComponent.cs +++ b/Content.Client/Nutrition/Components/ThirstComponent.cs @@ -22,7 +22,7 @@ namespace Content.Client.Nutrition.Components _currentThirstThreshold = thirst.CurrentThreshold; - EntitySystem.Get().RefreshMovementSpeedModifiers(((IComponent) this).Owner); + EntitySystem.Get().RefreshMovementSpeedModifiers(Owner); } } } diff --git a/Content.Server/Access/Components/IdCardConsoleComponent.cs b/Content.Server/Access/Components/IdCardConsoleComponent.cs index 8a3d400317..e31c97fedb 100644 --- a/Content.Server/Access/Components/IdCardConsoleComponent.cs +++ b/Content.Server/Access/Components/IdCardConsoleComponent.cs @@ -108,9 +108,9 @@ namespace Content.Server.Access.Components private void HandleIdButton(EntityUid user, ItemSlot slot) { if (slot.HasItem) - EntitySystem.Get().TryEjectToHands(((IComponent) this).Owner, slot, user); + EntitySystem.Get().TryEjectToHands(Owner, slot, user); else - EntitySystem.Get().TryInsertFromHand(((IComponent) this).Owner, slot, user); + EntitySystem.Get().TryInsertFromHand(Owner, slot, user); } public void UpdateUserInterface() diff --git a/Content.Server/Arcade/Components/BlockGameArcadeComponent.cs b/Content.Server/Arcade/Components/BlockGameArcadeComponent.cs index c492f16f8b..24139d624b 100644 --- a/Content.Server/Arcade/Components/BlockGameArcadeComponent.cs +++ b/Content.Server/Arcade/Components/BlockGameArcadeComponent.cs @@ -131,7 +131,7 @@ namespace Content.Server.Arcade.Components if (obj.Session != _player) break; // TODO: Should this check if the Owner can interact...? - if (!EntitySystem.Get().CanInteract(((IComponent) this).Owner)) + if (!EntitySystem.Get().CanInteract(Owner)) { DeactivePlayer(obj.Session); break; diff --git a/Content.Server/Atmos/Components/GasTankComponent.cs b/Content.Server/Atmos/Components/GasTankComponent.cs index a32b58c102..ca5fca1754 100644 --- a/Content.Server/Atmos/Components/GasTankComponent.cs +++ b/Content.Server/Atmos/Components/GasTankComponent.cs @@ -269,7 +269,7 @@ namespace Content.Server.Atmos.Components range = MaxExplosionRange; } - EntitySystem.Get().SpawnExplosion(((IComponent) this).Owner, (int) (range * 0.25f), (int) (range * 0.5f), (int) (range * 1.5f), 1); + EntitySystem.Get().SpawnExplosion(Owner, (int) (range * 0.25f), (int) (range * 0.5f), (int) (range * 1.5f), 1); IoCManager.Resolve().QueueDeleteEntity(Owner); return; diff --git a/Content.Server/Botany/Components/PlantHolderComponent.cs b/Content.Server/Botany/Components/PlantHolderComponent.cs index 075a14178a..b6f42ac23f 100644 --- a/Content.Server/Botany/Components/PlantHolderComponent.cs +++ b/Content.Server/Botany/Components/PlantHolderComponent.cs @@ -562,10 +562,10 @@ namespace Content.Server.Botany.Components else { 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(reagent); - reagentProto.ReactionPlant(((IComponent) this).Owner, new Solution.ReagentQuantity(reagent, amt), solution); + reagentProto.ReactionPlant(Owner, new Solution.ReagentQuantity(reagent, amt), solution); } } diff --git a/Content.Server/Cargo/Components/CargoTelepadComponent.cs b/Content.Server/Cargo/Components/CargoTelepadComponent.cs index d83581a34e..3a238f24a5 100644 --- a/Content.Server/Cargo/Components/CargoTelepadComponent.cs +++ b/Content.Server/Cargo/Components/CargoTelepadComponent.cs @@ -141,7 +141,7 @@ namespace Content.Server.Cargo.Components // attempt to attach the label if (IoCManager.Resolve().TryGetComponent(product, out PaperLabelComponent label)) { - EntitySystem.Get().TryInsert(((IComponent) this).Owner, label.LabelSlot, printed); + EntitySystem.Get().TryInsert(Owner, label.LabelSlot, printed); } } diff --git a/Content.Server/Chemistry/Components/ChemMasterComponent.cs b/Content.Server/Chemistry/Components/ChemMasterComponent.cs index b04d92beb9..afba36220f 100644 --- a/Content.Server/Chemistry/Components/ChemMasterComponent.cs +++ b/Content.Server/Chemistry/Components/ChemMasterComponent.cs @@ -121,7 +121,7 @@ namespace Content.Server.Chemistry.Components switch (msg.Action) { case UiAction.Eject: - EntitySystem.Get().TryEjectToHands(((IComponent) this).Owner, BeakerSlot, player); + EntitySystem.Get().TryEjectToHands(Owner, BeakerSlot, player); break; case UiAction.ChemButton: TransferReagent(msg.Id, msg.Amount, msg.IsBuffer); diff --git a/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs b/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs index 05bf0abca1..19c63bba8f 100644 --- a/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs +++ b/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs @@ -149,7 +149,7 @@ namespace Content.Server.Chemistry.Components switch (msg.Button) { case UiButton.Eject: - EntitySystem.Get().TryEjectToHands(((IComponent) this).Owner, BeakerSlot, obj.Session.AttachedEntity); + EntitySystem.Get().TryEjectToHands(Owner, BeakerSlot, obj.Session.AttachedEntity); break; case UiButton.Clear: TryClear(); diff --git a/Content.Server/Climbing/Components/ClimbingComponent.cs b/Content.Server/Climbing/Components/ClimbingComponent.cs index c78430b4b6..8bcc497b4d 100644 --- a/Content.Server/Climbing/Components/ClimbingComponent.cs +++ b/Content.Server/Climbing/Components/ClimbingComponent.cs @@ -85,7 +85,7 @@ namespace Content.Server.Climbing.Components Body.ApplyLinearImpulse((to - from).Normalized * velocity * Body.Mass * 5); OwnerIsTransitioning = true; - EntitySystem.Get().UnsetTransitionBoolAfterBufferTime(((IComponent) this).Owner, this); + EntitySystem.Get().UnsetTransitionBoolAfterBufferTime(Owner, this); } public void Update() diff --git a/Content.Server/Construction/Components/MachineFrameComponent.cs b/Content.Server/Construction/Components/MachineFrameComponent.cs index 260cd8a8e9..d1854a7516 100644 --- a/Content.Server/Construction/Components/MachineFrameComponent.cs +++ b/Content.Server/Construction/Components/MachineFrameComponent.cs @@ -124,7 +124,7 @@ namespace Content.Server.Construction.Components if (IoCManager.Resolve().TryGetComponent(Owner, out var construction)) { // Attempt to set pathfinding to the machine node... - EntitySystem.Get().SetPathfindingTarget(((IComponent) this).Owner, "machine", construction); + EntitySystem.Get().SetPathfindingTarget(Owner, "machine", construction); } } @@ -271,7 +271,7 @@ namespace Content.Server.Construction.Components if (IoCManager.Resolve().TryGetComponent(Owner, out ConstructionComponent? construction)) { // So prying the components off works correctly. - EntitySystem.Get().ResetEdge(((IComponent) this).Owner, construction); + EntitySystem.Get().ResetEdge(Owner, construction); } return true; diff --git a/Content.Server/Disposal/Tube/Components/DisposalEntryComponent.cs b/Content.Server/Disposal/Tube/Components/DisposalEntryComponent.cs index b147cd2411..51705e8a1a 100644 --- a/Content.Server/Disposal/Tube/Components/DisposalEntryComponent.cs +++ b/Content.Server/Disposal/Tube/Components/DisposalEntryComponent.cs @@ -32,7 +32,7 @@ namespace Content.Server.Disposal.Tube.Components EntitySystem.Get().Merge(holderComponent.Air, from.Air); from.Air.Clear(); - return EntitySystem.Get().EnterTube(((IComponent) holderComponent).Owner, ((IComponent) this).Owner, holderComponent, null, this); + return EntitySystem.Get().EnterTube(((IComponent) holderComponent).Owner, Owner, holderComponent, null, this); } protected override Direction[] ConnectableDirections() diff --git a/Content.Server/Ghost/Roles/Components/GhostRoleMobSpawnerComponent.cs b/Content.Server/Ghost/Roles/Components/GhostRoleMobSpawnerComponent.cs index 35de4887fa..f75c4f273c 100644 --- a/Content.Server/Ghost/Roles/Components/GhostRoleMobSpawnerComponent.cs +++ b/Content.Server/Ghost/Roles/Components/GhostRoleMobSpawnerComponent.cs @@ -48,7 +48,7 @@ namespace Content.Server.Ghost.Roles.Components mob.EnsureComponent(); var ghostRoleSystem = EntitySystem.Get(); - ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, ((IComponent) this).Owner, mob, this); + ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, Owner, mob, this); if (++_currentTakeovers < _availableTakeovers) return true; diff --git a/Content.Server/Ghost/Roles/Components/GhostTakeoverAvailableComponent.cs b/Content.Server/Ghost/Roles/Components/GhostTakeoverAvailableComponent.cs index d78feb79b3..9c0083849d 100644 --- a/Content.Server/Ghost/Roles/Components/GhostTakeoverAvailableComponent.cs +++ b/Content.Server/Ghost/Roles/Components/GhostTakeoverAvailableComponent.cs @@ -30,10 +30,10 @@ namespace Content.Server.Ghost.Roles.Components return false; if (MakeSentient) - MakeSentientCommand.MakeSentient(((IComponent) this).Owner, IoCManager.Resolve()); + MakeSentientCommand.MakeSentient(Owner, IoCManager.Resolve()); var ghostRoleSystem = EntitySystem.Get(); - ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, ((IComponent) this).Owner, ((IComponent) this).Owner, this); + ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, Owner, Owner, this); ghostRoleSystem.UnregisterGhostRole(this); diff --git a/Content.Server/Inventory/Components/InventoryComponent.cs b/Content.Server/Inventory/Components/InventoryComponent.cs index 7bbc4e0e28..f0aade547d 100644 --- a/Content.Server/Inventory/Components/InventoryComponent.cs +++ b/Content.Server/Inventory/Components/InventoryComponent.cs @@ -201,7 +201,7 @@ namespace Content.Server.Inventory.Components var pass = false; reason = null; - if (mobCheck && !EntitySystem.Get().CanEquip(((IComponent) this).Owner)) + if (mobCheck && !EntitySystem.Get().CanEquip(Owner)) { reason = Loc.GetString("inventory-component-can-equip-cannot"); return false; @@ -288,7 +288,7 @@ namespace Content.Server.Inventory.Components private void UpdateMovementSpeed() { - EntitySystem.Get().RefreshMovementSpeedModifiers(((IComponent) this).Owner); + EntitySystem.Get().RefreshMovementSpeedModifiers(Owner); } public void ForceUnequip(Slots slot) @@ -323,7 +323,7 @@ namespace Content.Server.Inventory.Components /// public bool CanUnequip(Slots slot, bool mobCheck = true) { - if (mobCheck && !EntitySystem.Get().CanUnequip(((IComponent) this).Owner)) + if (mobCheck && !EntitySystem.Get().CanUnequip(Owner)) return false; var inventorySlot = _slotContainers[slot]; diff --git a/Content.Server/Nutrition/Components/HungerComponent.cs b/Content.Server/Nutrition/Components/HungerComponent.cs index ce35c8e00b..196b733075 100644 --- a/Content.Server/Nutrition/Components/HungerComponent.cs +++ b/Content.Server/Nutrition/Components/HungerComponent.cs @@ -90,7 +90,7 @@ namespace Content.Server.Nutrition.Components if (_lastHungerThreshold == HungerThreshold.Starving && _currentHungerThreshold != HungerThreshold.Dead && IoCManager.Resolve().TryGetComponent(Owner, out MovementSpeedModifierComponent? movementSlowdownComponent)) { - EntitySystem.Get().RefreshMovementSpeedModifiers(((IComponent) this).Owner); + EntitySystem.Get().RefreshMovementSpeedModifiers(Owner); } // Update UI @@ -126,7 +126,7 @@ namespace Content.Server.Nutrition.Components case HungerThreshold.Starving: // 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. - EntitySystem.Get().RefreshMovementSpeedModifiers(((IComponent) this).Owner); + EntitySystem.Get().RefreshMovementSpeedModifiers(Owner); _lastHungerThreshold = _currentHungerThreshold; _actualDecayRate = _baseDecayRate * 0.6f; return; diff --git a/Content.Server/Nutrition/Components/ThirstComponent.cs b/Content.Server/Nutrition/Components/ThirstComponent.cs index 233aa87a75..f5956bdc1a 100644 --- a/Content.Server/Nutrition/Components/ThirstComponent.cs +++ b/Content.Server/Nutrition/Components/ThirstComponent.cs @@ -89,7 +89,7 @@ namespace Content.Server.Nutrition.Components if (_lastThirstThreshold == ThirstThreshold.Parched && _currentThirstThreshold != ThirstThreshold.Dead && IoCManager.Resolve().TryGetComponent(Owner, out MovementSpeedModifierComponent? movementSlowdownComponent)) { - EntitySystem.Get().RefreshMovementSpeedModifiers(((IComponent) this).Owner); + EntitySystem.Get().RefreshMovementSpeedModifiers(Owner); } // Update UI @@ -123,7 +123,7 @@ namespace Content.Server.Nutrition.Components return; case ThirstThreshold.Parched: - EntitySystem.Get().RefreshMovementSpeedModifiers(((IComponent) this).Owner); + EntitySystem.Get().RefreshMovementSpeedModifiers(Owner); _lastThirstThreshold = _currentThirstThreshold; _actualDecayRate = _baseDecayRate * 0.6f; return; diff --git a/Content.Server/PowerCell/Components/PowerCellComponent.cs b/Content.Server/PowerCell/Components/PowerCellComponent.cs index 81ac3dca80..c0cda8d0ff 100644 --- a/Content.Server/PowerCell/Components/PowerCellComponent.cs +++ b/Content.Server/PowerCell/Components/PowerCellComponent.cs @@ -73,7 +73,7 @@ namespace Content.Server.PowerCell.Components var light = (int) Math.Ceiling(Math.Sqrt(CurrentCharge) / 30); CurrentCharge = 0; - EntitySystem.Get().SpawnExplosion(((IComponent) this).Owner, 0, heavy, light, light*2); + EntitySystem.Get().SpawnExplosion(Owner, 0, heavy, light, light*2); IoCManager.Resolve().DeleteEntity(Owner); } diff --git a/Content.Server/Shuttles/Components/ThrusterComponent.cs b/Content.Server/Shuttles/Components/ThrusterComponent.cs index 743183ec8c..44be1f4b43 100644 --- a/Content.Server/Shuttles/Components/ThrusterComponent.cs +++ b/Content.Server/Shuttles/Components/ThrusterComponent.cs @@ -33,11 +33,11 @@ namespace Content.Server.Shuttles.Components 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); } } } diff --git a/Content.Server/Storage/Components/EntityStorageComponent.cs b/Content.Server/Storage/Components/EntityStorageComponent.cs index c854be1fe9..a227f78874 100644 --- a/Content.Server/Storage/Components/EntityStorageComponent.cs +++ b/Content.Server/Storage/Components/EntityStorageComponent.cs @@ -221,7 +221,7 @@ namespace Content.Server.Storage.Components var targetIsItem = IoCManager.Resolve().HasComponent(entity); var targetIsMob = IoCManager.Resolve().HasComponent(entity); - var storageIsItem = IoCManager.Resolve().HasComponent(((IComponent) this).Owner); + var storageIsItem = IoCManager.Resolve().HasComponent(Owner); var allowedToEat = false; diff --git a/Content.Server/Storage/Components/ServerStorageComponent.cs b/Content.Server/Storage/Components/ServerStorageComponent.cs index f2286998db..12ec21c6d6 100644 --- a/Content.Server/Storage/Components/ServerStorageComponent.cs +++ b/Content.Server/Storage/Components/ServerStorageComponent.cs @@ -94,7 +94,7 @@ namespace Content.Server.Storage.Components private void UpdateStorageVisualization() { - if (!_entityManager.TryGetComponent(((IComponent) this).Owner, out AppearanceComponent appearance)) + if (!_entityManager.TryGetComponent(Owner, out AppearanceComponent appearance)) return; bool open = SubscribedSessions.Count != 0; @@ -102,7 +102,7 @@ namespace Content.Server.Storage.Components appearance.SetData(StorageVisuals.Open, open); appearance.SetData(SharedBagOpenVisuals.BagState, open ? SharedBagState.Open : SharedBagState.Closed); - if (_entityManager.HasComponent(((IComponent) this).Owner)) + if (_entityManager.HasComponent(Owner)) appearance.SetData(StackVisuals.Hide, !open); } @@ -402,7 +402,7 @@ namespace Content.Server.Storage.Components { 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); } diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs index ac08b84681..f79374e3fe 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs @@ -365,7 +365,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components _entities.GetComponent(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)); } diff --git a/Content.Shared/Actions/Components/ItemActionsComponent.cs b/Content.Shared/Actions/Components/ItemActionsComponent.cs index d01738fe06..56bbdbac3c 100644 --- a/Content.Shared/Actions/Components/ItemActionsComponent.cs +++ b/Content.Shared/Actions/Components/ItemActionsComponent.cs @@ -86,7 +86,7 @@ namespace Content.Shared.Actions.Components if (_holderActionsComponent == null) return; 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; 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; _actions[actionType] = actionState; - _holderActionsComponent?.GrantOrUpdateItemAction(actionType, ((IComponent) this).Owner, actionState); + _holderActionsComponent?.GrantOrUpdateItemAction(actionType, Owner, actionState); } /// diff --git a/Content.Shared/Body/Components/SharedBodyComponent.cs b/Content.Shared/Body/Components/SharedBodyComponent.cs index b9dcbbd644..2262102e6b 100644 --- a/Content.Shared/Body/Components/SharedBodyComponent.cs +++ b/Content.Shared/Body/Components/SharedBodyComponent.cs @@ -146,7 +146,7 @@ namespace Content.Shared.Body.Components var argsAdded = new BodyPartAddedEventArgs(slot.Id, part); - EntitySystem.Get().BodyPartAdded(((IComponent) this).Owner, argsAdded); + EntitySystem.Get().BodyPartAdded(Owner, argsAdded); foreach (var component in IoCManager.Resolve().GetComponents(Owner).ToArray()) { component.BodyPartAdded(argsAdded); @@ -174,7 +174,7 @@ namespace Content.Shared.Body.Components var args = new BodyPartRemovedEventArgs(slot.Id, part); - EntitySystem.Get().BodyPartRemoved(((IComponent) this).Owner, args); + EntitySystem.Get().BodyPartRemoved(Owner, args); foreach (var component in IoCManager.Resolve().GetComponents(Owner)) { component.BodyPartRemoved(args); @@ -184,7 +184,7 @@ namespace Content.Shared.Body.Components if (part.PartType == BodyPartType.Leg && GetPartsOfType(BodyPartType.Leg).ToArray().Length == 0) { - EntitySystem.Get().Down(((IComponent) this).Owner); + EntitySystem.Get().Down(Owner); } if (part.IsVital && SlotParts.Count(x => x.Value.PartType == part.PartType) == 0) diff --git a/Content.Shared/Body/Components/SharedMechanismComponent.cs b/Content.Shared/Body/Components/SharedMechanismComponent.cs index 337a5c4069..c8bc821454 100644 --- a/Content.Shared/Body/Components/SharedMechanismComponent.cs +++ b/Content.Shared/Body/Components/SharedMechanismComponent.cs @@ -37,11 +37,11 @@ namespace Content.Shared.Body.Components { if (old.Body == null) { - IoCManager.Resolve().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new RemovedFromPartEvent(old)); + IoCManager.Resolve().EventBus.RaiseLocalEvent(Owner, new RemovedFromPartEvent(old)); } else { - IoCManager.Resolve().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new RemovedFromPartInBodyEvent(old.Body, old)); + IoCManager.Resolve().EventBus.RaiseLocalEvent(Owner, new RemovedFromPartInBodyEvent(old.Body, old)); } } @@ -49,11 +49,11 @@ namespace Content.Shared.Body.Components { if (value.Body == null) { - IoCManager.Resolve().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new AddedToPartEvent(value)); + IoCManager.Resolve().EventBus.RaiseLocalEvent(Owner, new AddedToPartEvent(value)); } else { - IoCManager.Resolve().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new AddedToPartInBodyEvent(value.Body, value)); + IoCManager.Resolve().EventBus.RaiseLocalEvent(Owner, new AddedToPartInBodyEvent(value.Body, value)); } } } diff --git a/Content.Shared/Damage/Components/DamageableComponent.cs b/Content.Shared/Damage/Components/DamageableComponent.cs index 72c9e03b5c..b8b42a03f0 100644 --- a/Content.Shared/Damage/Components/DamageableComponent.cs +++ b/Content.Shared/Damage/Components/DamageableComponent.cs @@ -95,7 +95,7 @@ namespace Content.Shared.Damage damage.DamageDict.Add(typeID, damageValue); } - var actual = EntitySystem.Get().TryChangeDamage(((IComponent) this).Owner, damage); + var actual = EntitySystem.Get().TryChangeDamage(Owner, damage); // should logging be disabled during rad storms? a lot of entities are going to be damaged. if (actual != null && !actual.Empty) @@ -120,7 +120,7 @@ namespace Content.Shared.Damage damage.DamageDict.Add(typeID, damageValue); } - var actual = EntitySystem.Get().TryChangeDamage(((IComponent) this).Owner, damage); + var actual = EntitySystem.Get().TryChangeDamage(Owner, damage); // will logging handle nukes? if (actual != null && !actual.Empty) diff --git a/Content.Shared/Hands/Components/SharedHandsComponent.cs b/Content.Shared/Hands/Components/SharedHandsComponent.cs index 357694ba31..4ad07c3b61 100644 --- a/Content.Shared/Hands/Components/SharedHandsComponent.cs +++ b/Content.Shared/Hands/Components/SharedHandsComponent.cs @@ -433,7 +433,7 @@ namespace Content.Shared.Hands.Components /// private bool PlayerCanDrop() { - if (!IoCManager.Resolve().GetEntitySystem().CanDrop(((IComponent) this).Owner)) + if (!IoCManager.Resolve().GetEntitySystem().CanDrop(Owner)) return false; return true; diff --git a/Content.Shared/MobState/Components/MobStateComponent.cs b/Content.Shared/MobState/Components/MobStateComponent.cs index ff550d5266..7394ee3a2f 100644 --- a/Content.Shared/MobState/Components/MobStateComponent.cs +++ b/Content.Shared/MobState/Components/MobStateComponent.cs @@ -291,7 +291,7 @@ namespace Content.Shared.MobState.Components { if (!current.HasValue) { - old?.ExitState(((IComponent) this).Owner, IoCManager.Resolve()); + old?.ExitState(Owner, IoCManager.Resolve()); return; } @@ -301,16 +301,16 @@ namespace Content.Shared.MobState.Components if (state == old) { - state.UpdateState(((IComponent) this).Owner, threshold, IoCManager.Resolve()); + state.UpdateState(Owner, threshold, IoCManager.Resolve()); return; } - old?.ExitState(((IComponent) this).Owner, IoCManager.Resolve()); + old?.ExitState(Owner, IoCManager.Resolve()); CurrentState = state; - state.EnterState(((IComponent) this).Owner, IoCManager.Resolve()); - state.UpdateState(((IComponent) this).Owner, threshold, IoCManager.Resolve()); + state.EnterState(Owner, IoCManager.Resolve()); + state.UpdateState(Owner, threshold, IoCManager.Resolve()); var message = new MobStateChangedMessage(this, old, state); #pragma warning disable 618