Inline OwnerUid
This commit is contained in:
@@ -24,7 +24,7 @@ namespace Content.Client.Atmos.Visualizers
|
||||
{
|
||||
base.OnChangeData(component);
|
||||
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(component.OwnerUid, out SpriteComponent? sprite))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(((IComponent) component).Owner, out SpriteComponent? sprite))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Content.Client.Atmos.Visualizers
|
||||
{
|
||||
base.OnChangeData(component);
|
||||
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(component.OwnerUid, out SpriteComponent? sprite))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(((IComponent) component).Owner, out SpriteComponent? sprite))
|
||||
return;
|
||||
|
||||
if (component.TryGetData(PipeColorVisuals.Color, out Color color))
|
||||
|
||||
@@ -319,7 +319,7 @@ namespace Content.Client.Instruments
|
||||
foreach (var instrument in EntityManager.EntityQuery<InstrumentComponent>(true))
|
||||
{
|
||||
if (instrument.DirtyRenderer && instrument.Renderer != null)
|
||||
UpdateRenderer(instrument.OwnerUid, instrument);
|
||||
UpdateRenderer(((IComponent) instrument).Owner, instrument);
|
||||
|
||||
if (!instrument.IsMidiOpen && !instrument.IsInputOpen)
|
||||
continue;
|
||||
@@ -366,7 +366,7 @@ namespace Content.Client.Instruments
|
||||
if (eventCount == 0)
|
||||
continue;
|
||||
|
||||
RaiseNetworkEvent(new InstrumentMidiEventEvent(instrument.OwnerUid, events));
|
||||
RaiseNetworkEvent(new InstrumentMidiEventEvent(((IComponent) instrument).Owner, events));
|
||||
|
||||
instrument.SentWithinASec += eventCount;
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Content.Client.Instruments.UI
|
||||
await Task.WhenAll(Timer.Delay(100), file.CopyToAsync(memStream));
|
||||
|
||||
if (_owner.Instrument is not {} instrument
|
||||
|| !EntitySystem.Get<InstrumentSystem>().OpenMidi(instrument.OwnerUid, memStream.GetBuffer().AsSpan(0, (int) memStream.Length), instrument))
|
||||
|| !EntitySystem.Get<InstrumentSystem>().OpenMidi(((IComponent) instrument).Owner, memStream.GetBuffer().AsSpan(0, (int) memStream.Length), instrument))
|
||||
return;
|
||||
|
||||
MidiPlaybackSetButtonsDisabled(false);
|
||||
@@ -123,10 +123,10 @@ namespace Content.Client.Instruments.UI
|
||||
|
||||
MidiStopButtonOnPressed(null);
|
||||
if(_owner.Instrument is {} instrument)
|
||||
instrumentSystem.OpenInput(instrument.OwnerUid, instrument);
|
||||
instrumentSystem.OpenInput(((IComponent) instrument).Owner, instrument);
|
||||
}
|
||||
else if(_owner.Instrument is {} instrument)
|
||||
instrumentSystem.CloseInput(instrument.OwnerUid, false, instrument);
|
||||
instrumentSystem.CloseInput(((IComponent) instrument).Owner, false, instrument);
|
||||
}
|
||||
|
||||
private bool PlayCheck()
|
||||
@@ -162,7 +162,7 @@ namespace Content.Client.Instruments.UI
|
||||
if (_owner.Instrument is not { } instrument)
|
||||
return;
|
||||
|
||||
EntitySystem.Get<InstrumentSystem>().CloseMidi(instrument.OwnerUid, false, instrument);
|
||||
EntitySystem.Get<InstrumentSystem>().CloseMidi(((IComponent) instrument).Owner, false, instrument);
|
||||
}
|
||||
|
||||
private void MidiLoopButtonOnOnToggled(ButtonToggledEventArgs obj)
|
||||
@@ -179,14 +179,14 @@ namespace Content.Client.Instruments.UI
|
||||
// Do not seek while still grabbing.
|
||||
if (PlaybackSlider.Grabbed || _owner.Instrument is not {} instrument) return;
|
||||
|
||||
EntitySystem.Get<InstrumentSystem>().SetPlayerTick(instrument.OwnerUid, (int)Math.Ceiling(PlaybackSlider.Value), instrument);
|
||||
EntitySystem.Get<InstrumentSystem>().SetPlayerTick(((IComponent) instrument).Owner, (int)Math.Ceiling(PlaybackSlider.Value), instrument);
|
||||
}
|
||||
|
||||
private void PlaybackSliderKeyUp(GUIBoundKeyEventArgs args)
|
||||
{
|
||||
if (args.Function != EngineKeyFunctions.UIClick || _owner.Instrument is not {} instrument) return;
|
||||
|
||||
EntitySystem.Get<InstrumentSystem>().SetPlayerTick(instrument.OwnerUid, (int)Math.Ceiling(PlaybackSlider.Value), instrument);
|
||||
EntitySystem.Get<InstrumentSystem>().SetPlayerTick(((IComponent) instrument).Owner, (int)Math.Ceiling(PlaybackSlider.Value), instrument);
|
||||
}
|
||||
|
||||
protected override void FrameUpdate(FrameEventArgs args)
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace Content.Client.Inventory
|
||||
}
|
||||
}
|
||||
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(OwnerUid);
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner);
|
||||
}
|
||||
|
||||
private void _setSlot(Slots slot, IEntity entity)
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Content.Client.Mining
|
||||
{
|
||||
base.OnChangeData(component);
|
||||
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(component.OwnerUid, out SpriteComponent? sprite))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(((IComponent) component).Owner, out SpriteComponent? sprite))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Content.Client.Nutrition.Components
|
||||
|
||||
_currentHungerThreshold = hunger.CurrentThreshold;
|
||||
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(OwnerUid);
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Content.Client.Nutrition.Components
|
||||
|
||||
_currentThirstThreshold = thirst.CurrentThreshold;
|
||||
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(OwnerUid);
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Content.Client.Singularity.Visualizers
|
||||
{
|
||||
base.OnChangeData(component);
|
||||
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(component.OwnerUid, out SpriteComponent? sprite))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(((IComponent) component).Owner, out SpriteComponent? sprite))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace Content.IntegrationTests.Tests.Body
|
||||
gas.AdjustMoles(Gas.Nitrogen, originalNitrogen);
|
||||
|
||||
var (lung, _) = lungs[0];
|
||||
lungSys.TakeGasFrom(lung.OwnerUid, 1, gas, lung);
|
||||
lungSys.TakeGasFrom(((IComponent) lung).Owner, 1, gas, lung);
|
||||
|
||||
var lungOxygen = originalOxygen * breathedPercentage;
|
||||
var lungNitrogen = originalNitrogen * breathedPercentage;
|
||||
@@ -103,7 +103,7 @@ namespace Content.IntegrationTests.Tests.Body
|
||||
Assert.Zero(lungOxygenBeforeExhale);
|
||||
Assert.Zero(lungNitrogenBeforeExhale);
|
||||
|
||||
lungSys.PushGasTo(lung.OwnerUid, gas, lung);
|
||||
lungSys.PushGasTo(((IComponent) lung).Owner, gas, lung);
|
||||
|
||||
var lungOxygenAfterExhale = lung.Air.GetMoles(Gas.Oxygen);
|
||||
var exhaledOxygen = Math.Abs(lungOxygenBeforeExhale - lungOxygenAfterExhale);
|
||||
|
||||
@@ -110,9 +110,9 @@ namespace Content.Server.Access.Components
|
||||
private void HandleIdButton(IEntity user, ItemSlot slot)
|
||||
{
|
||||
if (slot.HasItem)
|
||||
EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(OwnerUid, slot, user);
|
||||
EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(((IComponent) this).Owner, slot, user);
|
||||
else
|
||||
EntitySystem.Get<ItemSlotsSystem>().TryInsertFromHand(OwnerUid, slot, user);
|
||||
EntitySystem.Get<ItemSlotsSystem>().TryInsertFromHand(((IComponent) this).Owner, slot, user);
|
||||
}
|
||||
|
||||
public void UpdateUserInterface()
|
||||
|
||||
@@ -59,7 +59,7 @@ public partial class AdminLogSystem
|
||||
EntityUid id => id,
|
||||
IEntity entity => entity,
|
||||
IPlayerSession {AttachedEntityUid: { }} session => session.AttachedEntityUid.Value,
|
||||
IComponent component => component.OwnerUid,
|
||||
IComponent component => component.Owner,
|
||||
_ => null
|
||||
};
|
||||
|
||||
|
||||
@@ -51,11 +51,11 @@ namespace Content.Server.Animals.Systems
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!_solutionContainerSystem.TryGetSolution(udder.OwnerUid, udder.TargetSolutionName, out var solution))
|
||||
if (!_solutionContainerSystem.TryGetSolution(((IComponent) udder).Owner, udder.TargetSolutionName, out var solution))
|
||||
continue;
|
||||
|
||||
//TODO: toxins from bloodstream !?
|
||||
_solutionContainerSystem.TryAddReagent(udder.OwnerUid, solution, udder.ReagentId, udder.QuantityPerUpdate, out var accepted);
|
||||
_solutionContainerSystem.TryAddReagent(((IComponent) udder).Owner, solution, udder.ReagentId, udder.QuantityPerUpdate, out var accepted);
|
||||
udder.AccumulatedFrameTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<ActionBlockerSystem>().CanInteract(OwnerUid))
|
||||
if (!EntitySystem.Get<ActionBlockerSystem>().CanInteract(((IComponent) this).Owner))
|
||||
{
|
||||
DeactivePlayer(obj.Session);
|
||||
break;
|
||||
|
||||
@@ -269,7 +269,7 @@ namespace Content.Server.Atmos.Components
|
||||
range = MaxExplosionRange;
|
||||
}
|
||||
|
||||
EntitySystem.Get<ExplosionSystem>().SpawnExplosion(OwnerUid, (int) (range * 0.25f), (int) (range * 0.5f), (int) (range * 1.5f), 1);
|
||||
EntitySystem.Get<ExplosionSystem>().SpawnExplosion(((IComponent) this).Owner, (int) (range * 0.25f), (int) (range * 0.5f), (int) (range * 1.5f), 1);
|
||||
|
||||
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity((EntityUid) Owner);
|
||||
return;
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
{
|
||||
airtight.AirBlocked = airblocked;
|
||||
UpdatePosition(airtight);
|
||||
RaiseLocalEvent(airtight.OwnerUid, new AirtightChanged(airtight));
|
||||
RaiseLocalEvent(((IComponent) airtight).Owner, new AirtightChanged(airtight));
|
||||
}
|
||||
|
||||
public void UpdatePosition(AirtightComponent airtight)
|
||||
|
||||
@@ -201,9 +201,9 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
var fireStackDelta = fireStackMod - flammable.FireStacks;
|
||||
if (fireStackDelta > 0)
|
||||
{
|
||||
AdjustFireStacks(flammable.OwnerUid, fireStackDelta, flammable);
|
||||
AdjustFireStacks(((IComponent) flammable).Owner, fireStackDelta, flammable);
|
||||
}
|
||||
Ignite(flammable.OwnerUid, flammable);
|
||||
Ignite(((IComponent) flammable).Owner, flammable);
|
||||
}
|
||||
_fireEvents.Clear();
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Content.Server.Body.Systems
|
||||
foreach (var (part, _) in body.Parts)
|
||||
foreach (var mechanism in part.Mechanisms)
|
||||
{
|
||||
if (EntityManager.TryGetComponent<T>(mechanism.OwnerUid, out var comp))
|
||||
if (EntityManager.TryGetComponent<T>(((IComponent) mechanism).Owner, out var comp))
|
||||
yield return (comp, mechanism);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,12 +14,12 @@ namespace Content.Server.Body.Systems
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<BrainComponent, AddedToBodyEvent>((uid, component, args) => HandleMind(args.Body.OwnerUid, uid));
|
||||
SubscribeLocalEvent<BrainComponent, AddedToPartEvent>((uid, component, args) => HandleMind(args.Part.OwnerUid, uid));
|
||||
SubscribeLocalEvent<BrainComponent, AddedToPartInBodyEvent>((uid, component, args) => HandleMind(args.Body.OwnerUid, uid));
|
||||
SubscribeLocalEvent<BrainComponent, AddedToBodyEvent>((uid, component, args) => HandleMind(((IComponent) args.Body).Owner, uid));
|
||||
SubscribeLocalEvent<BrainComponent, AddedToPartEvent>((uid, component, args) => HandleMind(((IComponent) args.Part).Owner, uid));
|
||||
SubscribeLocalEvent<BrainComponent, AddedToPartInBodyEvent>((uid, component, args) => HandleMind(((IComponent) args.Body).Owner, uid));
|
||||
SubscribeLocalEvent<BrainComponent, RemovedFromBodyEvent>(OnRemovedFromBody);
|
||||
SubscribeLocalEvent<BrainComponent, RemovedFromPartEvent>((uid, component, args) => HandleMind(uid, args.Old.OwnerUid));
|
||||
SubscribeLocalEvent<BrainComponent, RemovedFromPartInBodyEvent>((uid, component, args) => HandleMind(args.OldBody.OwnerUid, uid));
|
||||
SubscribeLocalEvent<BrainComponent, RemovedFromPartEvent>((uid, component, args) => HandleMind(uid, ((IComponent) args.Old).Owner));
|
||||
SubscribeLocalEvent<BrainComponent, RemovedFromPartInBodyEvent>((uid, component, args) => HandleMind(((IComponent) args.OldBody).Owner, uid));
|
||||
}
|
||||
|
||||
private void OnRemovedFromBody(EntityUid uid, BrainComponent component, RemovedFromBodyEvent args)
|
||||
@@ -28,7 +28,7 @@ namespace Content.Server.Body.Systems
|
||||
if (!EntityManager.TryGetComponent(uid, out MechanismComponent mech))
|
||||
return;
|
||||
|
||||
HandleMind(mech.Part!.OwnerUid, args.Old.OwnerUid);
|
||||
HandleMind(((IComponent) mech.Part!).Owner, ((IComponent) args.Old).Owner);
|
||||
}
|
||||
|
||||
private void HandleMind(EntityUid newEntity, EntityUid oldEntity)
|
||||
|
||||
@@ -57,7 +57,7 @@ public class LungSystem : EntitySystem
|
||||
if (!Resolve(uid, ref lung, ref mech))
|
||||
return;
|
||||
|
||||
if (mech.Body != null && EntityManager.TryGetComponent(mech.Body.OwnerUid, out MobStateComponent? mobState) && mobState.IsCritical())
|
||||
if (mech.Body != null && EntityManager.TryGetComponent(((IComponent) mech.Body).Owner, out MobStateComponent? mobState) && mobState.IsCritical())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public class LungSystem : EntitySystem
|
||||
|
||||
// TODO Jesus Christ make this event based.
|
||||
if (mech.Body != null &&
|
||||
EntityManager.TryGetComponent(mech.Body.OwnerUid, out InternalsComponent? internals) &&
|
||||
EntityManager.TryGetComponent(((IComponent) mech.Body).Owner, out InternalsComponent? internals) &&
|
||||
internals.BreathToolEntity != null &&
|
||||
internals.GasTankEntity != null &&
|
||||
IoCManager.Resolve<IEntityManager>().TryGetComponent(internals.BreathToolEntity, out BreathToolComponent? breathTool) &&
|
||||
@@ -148,7 +148,7 @@ public class LungSystem : EntitySystem
|
||||
if (mech.Body == null)
|
||||
return;
|
||||
|
||||
if (!EntityManager.TryGetComponent(mech.Body.OwnerUid, out BloodstreamComponent? bloodstream))
|
||||
if (!EntityManager.TryGetComponent(((IComponent) mech.Body).Owner, out BloodstreamComponent? bloodstream))
|
||||
return;
|
||||
|
||||
var to = bloodstream.Air;
|
||||
@@ -189,10 +189,10 @@ public class LungSystem : EntitySystem
|
||||
if (mech.Body == null)
|
||||
return;
|
||||
|
||||
if (!EntityManager.TryGetComponent(mech.Body.OwnerUid, out BloodstreamComponent? bloodstream))
|
||||
if (!EntityManager.TryGetComponent(((IComponent) mech.Body).Owner, out BloodstreamComponent? bloodstream))
|
||||
return;
|
||||
|
||||
_bloodstreamSystem.PumpToxins(mech.Body.OwnerUid, lung.Air, bloodstream);
|
||||
_bloodstreamSystem.PumpToxins(((IComponent) mech.Body).Owner, lung.Air, bloodstream);
|
||||
|
||||
var lungRemoved = lung.Air.RemoveRatio(0.5f);
|
||||
_atmosSys.Merge(to, lungRemoved);
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Content.Server.Body.Systems
|
||||
{
|
||||
if (mech.Body != null)
|
||||
{
|
||||
_solutionContainerSystem.EnsureSolution(mech.Body.OwnerUid, component.SolutionName);
|
||||
_solutionContainerSystem.EnsureSolution(((IComponent) mech.Body).Owner, component.SolutionName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ namespace Content.Server.Body.Systems
|
||||
if (metab.AccumulatedFrametime >= metab.UpdateFrequency)
|
||||
{
|
||||
metab.AccumulatedFrametime -= metab.UpdateFrequency;
|
||||
TryMetabolize(metab.OwnerUid, metab);
|
||||
TryMetabolize(((IComponent) metab).Owner, metab);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,9 +86,9 @@ namespace Content.Server.Body.Systems
|
||||
|
||||
if (body != null)
|
||||
{
|
||||
if (!Resolve(body.OwnerUid, ref manager, false))
|
||||
if (!Resolve(((IComponent) body).Owner, ref manager, false))
|
||||
return;
|
||||
_solutionContainerSystem.TryGetSolution(body.OwnerUid, meta.SolutionName, out solution, manager);
|
||||
_solutionContainerSystem.TryGetSolution(((IComponent) body).Owner, meta.SolutionName, out solution, manager);
|
||||
solutionEntityUid = body.OwnerUid;
|
||||
}
|
||||
}
|
||||
@@ -152,7 +152,7 @@ namespace Content.Server.Body.Systems
|
||||
continue;
|
||||
}
|
||||
|
||||
var args = new ReagentEffectArgs(solutionEntityUid.Value, meta.OwnerUid, solution, proto, entry.MetabolismRate,
|
||||
var args = new ReagentEffectArgs(solutionEntityUid.Value, ((IComponent) meta).Owner, solution, proto, entry.MetabolismRate,
|
||||
EntityManager, null);
|
||||
|
||||
// do all effects, if conditions apply
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Content.Server.Body.Systems
|
||||
foreach (var (respirator, blood, body) in
|
||||
EntityManager.EntityQuery<RespiratorComponent, BloodstreamComponent, SharedBodyComponent>())
|
||||
{
|
||||
var uid = respirator.OwnerUid;
|
||||
var uid = ((IComponent) respirator).Owner;
|
||||
if (!EntityManager.TryGetComponent<MobStateComponent>(uid, out var state) ||
|
||||
state.IsDead())
|
||||
{
|
||||
@@ -144,7 +144,7 @@ namespace Content.Server.Body.Systems
|
||||
|
||||
foreach (var (lung, mech) in lungs)
|
||||
{
|
||||
_lungSystem.UpdateLung(lung.OwnerUid, frameTime, lung, mech);
|
||||
_lungSystem.UpdateLung(((IComponent) lung).Owner, frameTime, lung, mech);
|
||||
}
|
||||
|
||||
foreach (var (gas, amountNeeded) in needs)
|
||||
@@ -159,7 +159,7 @@ namespace Content.Server.Body.Systems
|
||||
// Panic inhale
|
||||
foreach (var (lung, mech) in lungs)
|
||||
{
|
||||
_lungSystem.Gasp(lung.OwnerUid, lung, mech);
|
||||
_lungSystem.Gasp(((IComponent) lung).Owner, lung, mech);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,11 +35,11 @@ namespace Content.Server.Body.Systems
|
||||
stomach.AccumulatedFrameTime -= stomach.UpdateInterval;
|
||||
|
||||
// Get our solutions
|
||||
if (!_solutionContainerSystem.TryGetSolution(stomach.OwnerUid, DefaultSolutionName,
|
||||
if (!_solutionContainerSystem.TryGetSolution(((IComponent) stomach).Owner, DefaultSolutionName,
|
||||
out var stomachSolution, sol))
|
||||
continue;
|
||||
|
||||
if (!_solutionContainerSystem.TryGetSolution(mech.Body.OwnerUid, stomach.BodySolutionName,
|
||||
if (!_solutionContainerSystem.TryGetSolution(((IComponent) mech.Body).Owner, stomach.BodySolutionName,
|
||||
out var bodySolution))
|
||||
continue;
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Content.Server.Body.Systems
|
||||
if (quant > delta.Quantity)
|
||||
quant = delta.Quantity;
|
||||
|
||||
_solutionContainerSystem.TryRemoveReagent(stomach.OwnerUid, stomachSolution,
|
||||
_solutionContainerSystem.TryRemoveReagent(((IComponent) stomach).Owner, stomachSolution,
|
||||
delta.ReagentId, quant);
|
||||
transferSolution.AddReagent(delta.ReagentId, quant);
|
||||
}
|
||||
@@ -71,7 +71,7 @@ namespace Content.Server.Body.Systems
|
||||
}
|
||||
|
||||
// Transfer everything to the body solution!
|
||||
_solutionContainerSystem.TryAddSolution(mech.Body.OwnerUid, bodySolution, transferSolution);
|
||||
_solutionContainerSystem.TryAddSolution(((IComponent) mech.Body).Owner, bodySolution, transferSolution);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ public class ThermalRegulatorSystem : EntitySystem
|
||||
continue;
|
||||
|
||||
regulator.AccumulatedFrametime -= 1;
|
||||
ProcessThermalRegulation(regulator.OwnerUid, regulator);
|
||||
ProcessThermalRegulation(((IComponent) regulator).Owner, regulator);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -563,10 +563,10 @@ namespace Content.Server.Botany.Components
|
||||
else
|
||||
{
|
||||
var amt = FixedPoint2.New(1);
|
||||
foreach (var reagent in solutionSystem.RemoveEachReagent(OwnerUid, solution, amt))
|
||||
foreach (var reagent in solutionSystem.RemoveEachReagent(((IComponent) this).Owner, solution, amt))
|
||||
{
|
||||
var reagentProto = _prototypeManager.Index<ReagentPrototype>(reagent);
|
||||
reagentProto.ReactionPlant(OwnerUid, new Solution.ReagentQuantity(reagent, amt), solution);
|
||||
reagentProto.ReactionPlant(((IComponent) this).Owner, new Solution.ReagentQuantity(reagent, amt), solution);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace Content.Server.Cargo.Components
|
||||
// attempt to attach the label
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(product, out PaperLabelComponent label))
|
||||
{
|
||||
EntitySystem.Get<ItemSlotsSystem>().TryInsert(OwnerUid, label.LabelSlot, printed);
|
||||
EntitySystem.Get<ItemSlotsSystem>().TryInsert(((IComponent) this).Owner, label.LabelSlot, printed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace Content.Server.Chemistry.Components
|
||||
switch (msg.Action)
|
||||
{
|
||||
case UiAction.Eject:
|
||||
EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(OwnerUid, BeakerSlot, obj.Session.AttachedEntityUid);
|
||||
EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(((IComponent) this).Owner, BeakerSlot, obj.Session.AttachedEntityUid);
|
||||
break;
|
||||
case UiAction.ChemButton:
|
||||
TransferReagent(msg.Id, msg.Amount, msg.IsBuffer);
|
||||
|
||||
@@ -192,7 +192,7 @@ namespace Content.Server.Chemistry.Components
|
||||
EntitySystem.Get<SolutionContainerSystem>().SplitSolution(user, targetBloodstream.Solution, realTransferAmount);
|
||||
|
||||
var bloodstreamSys = EntitySystem.Get<BloodstreamSystem>();
|
||||
bloodstreamSys.TryAddToBloodstream(targetBloodstream.OwnerUid, removedSolution, targetBloodstream);
|
||||
bloodstreamSys.TryAddToBloodstream(((IComponent) targetBloodstream).Owner, removedSolution, targetBloodstream);
|
||||
|
||||
removedSolution.DoEntityReaction(targetBloodstream.Owner, ReactionMethod.Injection);
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace Content.Server.Chemistry.Components
|
||||
switch (msg.Button)
|
||||
{
|
||||
case UiButton.Eject:
|
||||
EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(OwnerUid, BeakerSlot, obj.Session.AttachedEntityUid);
|
||||
EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(((IComponent) this).Owner, BeakerSlot, obj.Session.AttachedEntityUid);
|
||||
break;
|
||||
case UiButton.Clear:
|
||||
TryClear();
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
|
||||
var solToInject = solRemoved.SplitSolution(solRemovedVol * component.TransferEfficiency);
|
||||
|
||||
_bloodstreamSystem.TryAddToBloodstream(args.OtherFixture.Body.OwnerUid, solToInject, bloodstream);
|
||||
_bloodstreamSystem.TryAddToBloodstream(((IComponent) args.OtherFixture.Body).Owner, solToInject, bloodstream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,11 +81,11 @@ namespace Content.Server.Climbing.Components
|
||||
|
||||
// Since there are bodies with different masses:
|
||||
// mass * 5 seems enough to move entity
|
||||
// instead of launching cats like rockets against the walls with constant impulse value.
|
||||
// instead of launching cats like rockets against the walls with constant impulse value.
|
||||
Body.ApplyLinearImpulse((to - from).Normalized * velocity * Body.Mass * 5);
|
||||
OwnerIsTransitioning = true;
|
||||
|
||||
EntitySystem.Get<ClimbSystem>().UnsetTransitionBoolAfterBufferTime(OwnerUid, this);
|
||||
EntitySystem.Get<ClimbSystem>().UnsetTransitionBoolAfterBufferTime(((IComponent) this).Owner, this);
|
||||
}
|
||||
|
||||
public void Update()
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace Content.Server.Construction.Components
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<ConstructionComponent?>(Owner, out var construction))
|
||||
{
|
||||
// Attempt to set pathfinding to the machine node...
|
||||
EntitySystem.Get<ConstructionSystem>().SetPathfindingTarget(OwnerUid, "machine", construction);
|
||||
EntitySystem.Get<ConstructionSystem>().SetPathfindingTarget(((IComponent) this).Owner, "machine", construction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace Content.Server.Construction.Components
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out ConstructionComponent? construction))
|
||||
{
|
||||
// So prying the components off works correctly.
|
||||
EntitySystem.Get<ConstructionSystem>().ResetEdge(OwnerUid, construction);
|
||||
EntitySystem.Get<ConstructionSystem>().ResetEdge(((IComponent) this).Owner, construction);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Content.Server.Disposal.Tube.Components
|
||||
EntitySystem.Get<AtmosphereSystem>().Merge(holderComponent.Air, from.Air);
|
||||
from.Air.Clear();
|
||||
|
||||
return EntitySystem.Get<DisposableSystem>().EnterTube(holderComponent.OwnerUid, OwnerUid, holderComponent, null, this);
|
||||
return EntitySystem.Get<DisposableSystem>().EnterTube(((IComponent) holderComponent).Owner, ((IComponent) this).Owner, holderComponent, null, this);
|
||||
}
|
||||
|
||||
protected override Direction[] ConnectableDirections()
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace Content.Server.Disposal.Tube.Components
|
||||
continue;
|
||||
}
|
||||
|
||||
EntitySystem.Get<DisposableSystem>().ExitDisposals(holder.OwnerUid);
|
||||
EntitySystem.Get<DisposableSystem>().ExitDisposals(((IComponent) holder).Owner);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
||||
if (duc != null)
|
||||
{
|
||||
// Insert into disposal unit
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates = new EntityCoordinates(duc.OwnerUid, Vector2.Zero);
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates = new EntityCoordinates(((IComponent) duc).Owner, Vector2.Zero);
|
||||
duc.Container.Insert(entity);
|
||||
}
|
||||
else
|
||||
@@ -154,7 +154,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
||||
var currentTube = holder.CurrentTube;
|
||||
if (currentTube == null || currentTube.Deleted)
|
||||
{
|
||||
ExitDisposals(holder.OwnerUid);
|
||||
ExitDisposals(((IComponent) holder).Owner);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -175,15 +175,15 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
||||
currentTube.Contents.ForceRemove(holder.Owner);
|
||||
|
||||
// Find next tube
|
||||
var nextTube = _disposalTubeSystem.NextTubeFor(currentTube.OwnerUid, holder.CurrentDirection);
|
||||
var nextTube = _disposalTubeSystem.NextTubeFor(currentTube.Owner, holder.CurrentDirection);
|
||||
if (nextTube == null || nextTube.Deleted)
|
||||
{
|
||||
ExitDisposals(holder.OwnerUid);
|
||||
ExitDisposals(((IComponent) holder).Owner);
|
||||
break;
|
||||
}
|
||||
|
||||
// Perform remainder of entry process
|
||||
if (!EnterTube(holder.OwnerUid, nextTube.OwnerUid, holder, null, nextTube, null))
|
||||
if (!EnterTube(((IComponent) holder).Owner, nextTube.Owner, holder, null, nextTube, null))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace Content.Server.Fluids.Components
|
||||
}
|
||||
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(eventArgs.Target, out PuddleComponent? puddleComponent) ||
|
||||
!solutionSystem.TryGetSolution(puddleComponent.OwnerUid, puddleComponent.SolutionName, out var puddleSolution))
|
||||
!solutionSystem.TryGetSolution(((IComponent) puddleComponent).Owner, puddleComponent.SolutionName, out var puddleSolution))
|
||||
return false;
|
||||
|
||||
// So if the puddle has 20 units we mop in 2 seconds. Don't just store CurrentVolume given it can change so need to re-calc it anyway.
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Content.Server.Ghost.Roles.Components
|
||||
mob.EnsureComponent<MindComponent>();
|
||||
|
||||
var ghostRoleSystem = EntitySystem.Get<GhostRoleSystem>();
|
||||
ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, OwnerUid, mob, this);
|
||||
ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, ((IComponent) this).Owner, mob, this);
|
||||
|
||||
if (++_currentTakeovers < _availableTakeovers)
|
||||
return true;
|
||||
|
||||
@@ -30,10 +30,10 @@ namespace Content.Server.Ghost.Roles.Components
|
||||
return false;
|
||||
|
||||
if (MakeSentient)
|
||||
MakeSentientCommand.MakeSentient(OwnerUid, IoCManager.Resolve<IEntityManager>());
|
||||
MakeSentientCommand.MakeSentient(((IComponent) this).Owner, IoCManager.Resolve<IEntityManager>());
|
||||
|
||||
var ghostRoleSystem = EntitySystem.Get<GhostRoleSystem>();
|
||||
ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, OwnerUid, OwnerUid, this);
|
||||
ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, ((IComponent) this).Owner, ((IComponent) this).Owner, this);
|
||||
|
||||
ghostRoleSystem.UnregisterGhostRole(this);
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
|
||||
var mob = instrument.InstrumentPlayer.AttachedEntity;
|
||||
|
||||
// Just in case
|
||||
Clean(instrument.OwnerUid);
|
||||
Clean(((IComponent) instrument).Owner);
|
||||
instrument.UserInterface?.CloseAll();
|
||||
|
||||
if (mob != null)
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace Content.Server.Inventory.Components
|
||||
var pass = false;
|
||||
reason = null;
|
||||
|
||||
if (mobCheck && !EntitySystem.Get<ActionBlockerSystem>().CanEquip(OwnerUid))
|
||||
if (mobCheck && !EntitySystem.Get<ActionBlockerSystem>().CanEquip(((IComponent) this).Owner))
|
||||
{
|
||||
reason = Loc.GetString("inventory-component-can-equip-cannot");
|
||||
return false;
|
||||
@@ -295,7 +295,7 @@ namespace Content.Server.Inventory.Components
|
||||
|
||||
private void UpdateMovementSpeed()
|
||||
{
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(OwnerUid);
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner);
|
||||
}
|
||||
|
||||
public void ForceUnequip(Slots slot)
|
||||
@@ -331,7 +331,7 @@ namespace Content.Server.Inventory.Components
|
||||
/// </returns>
|
||||
public bool CanUnequip(Slots slot, bool mobCheck = true)
|
||||
{
|
||||
if (mobCheck && !EntitySystem.Get<ActionBlockerSystem>().CanUnequip(OwnerUid))
|
||||
if (mobCheck && !EntitySystem.Get<ActionBlockerSystem>().CanUnequip(((IComponent) this).Owner))
|
||||
return false;
|
||||
|
||||
var inventorySlot = _slotContainers[slot];
|
||||
|
||||
@@ -44,10 +44,10 @@ public class GrowingKudzuSystem : EntitySystem
|
||||
kudzu.GrowthLevel += 1;
|
||||
|
||||
if (kudzu.GrowthLevel == 3 &&
|
||||
EntityManager.TryGetComponent<SpreaderComponent>(kudzu.OwnerUid, out var spreader))
|
||||
EntityManager.TryGetComponent<SpreaderComponent>(((IComponent) kudzu).Owner, out var spreader))
|
||||
{
|
||||
// why cache when you can simply cease to be? Also saves a bit of memory/time.
|
||||
EntityManager.RemoveComponent<GrowingKudzuComponent>(kudzu.OwnerUid);
|
||||
EntityManager.RemoveComponent<GrowingKudzuComponent>(((IComponent) kudzu).Owner);
|
||||
}
|
||||
|
||||
appearance.SetData(KudzuVisuals.GrowthLevel, kudzu.GrowthLevel);
|
||||
|
||||
@@ -35,7 +35,7 @@ public class SpreaderSystem : EntitySystem
|
||||
|
||||
private void OnAirtightChanged(AirtightChanged e)
|
||||
{
|
||||
UpdateNearbySpreaders(e.Airtight.OwnerUid, e.Airtight);
|
||||
UpdateNearbySpreaders(((IComponent) e.Airtight).Owner, e.Airtight);
|
||||
}
|
||||
|
||||
private void SpreaderAddHandler(EntityUid uid, SpreaderComponent component, ComponentAdd args)
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace Content.Server.Nuke
|
||||
var consoles = EntityManager.EntityQuery<CommunicationsConsoleComponent>();
|
||||
foreach (var console in consoles)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(console.OwnerUid, out TransformComponent? transform))
|
||||
if (!EntityManager.TryGetComponent(((IComponent) console).Owner, out TransformComponent? transform))
|
||||
continue;
|
||||
|
||||
var consolePos = transform.MapPosition;
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace Content.Server.Nutrition.Components
|
||||
if (_lastHungerThreshold == HungerThreshold.Starving && _currentHungerThreshold != HungerThreshold.Dead &&
|
||||
IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out MovementSpeedModifierComponent? movementSlowdownComponent))
|
||||
{
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(OwnerUid);
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).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<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(OwnerUid);
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner);
|
||||
_lastHungerThreshold = _currentHungerThreshold;
|
||||
_actualDecayRate = _baseDecayRate * 0.6f;
|
||||
return;
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace Content.Server.Nutrition.Components
|
||||
if (_lastThirstThreshold == ThirstThreshold.Parched && _currentThirstThreshold != ThirstThreshold.Dead &&
|
||||
IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out MovementSpeedModifierComponent? movementSlowdownComponent))
|
||||
{
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(OwnerUid);
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner);
|
||||
}
|
||||
|
||||
// Update UI
|
||||
@@ -123,7 +123,7 @@ namespace Content.Server.Nutrition.Components
|
||||
return;
|
||||
|
||||
case ThirstThreshold.Parched:
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(OwnerUid);
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner);
|
||||
_lastThirstThreshold = _currentThirstThreshold;
|
||||
_actualDecayRate = _baseDecayRate * 0.6f;
|
||||
return;
|
||||
|
||||
@@ -218,13 +218,13 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
|
||||
public void UpdateAppearance(DrinkComponent component)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(component.OwnerUid, out AppearanceComponent? appearance) ||
|
||||
!EntityManager.HasComponent<SolutionContainerManagerComponent>(component.OwnerUid))
|
||||
if (!EntityManager.TryGetComponent(((IComponent) component).Owner, out AppearanceComponent? appearance) ||
|
||||
!EntityManager.HasComponent<SolutionContainerManagerComponent>(((IComponent) component).Owner))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var drainAvailable = _solutionContainerSystem.DrainAvailable(component.OwnerUid);
|
||||
var drainAvailable = _solutionContainerSystem.DrainAvailable(((IComponent) component).Owner);
|
||||
appearance.SetData(FoodVisuals.Visual, drainAvailable.Float());
|
||||
appearance.SetData(DrinkCanStateVisual.Opened, component.Opened);
|
||||
}
|
||||
@@ -248,7 +248,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
if (!EntityManager.TryGetComponent(userUid, out SharedBodyComponent? body))
|
||||
return false;
|
||||
|
||||
if (!_solutionContainerSystem.TryGetDrainableSolution(drink.OwnerUid, out var drinkSolution) ||
|
||||
if (!_solutionContainerSystem.TryGetDrainableSolution(((IComponent) drink).Owner, out var drinkSolution) ||
|
||||
drinkSolution.DrainAvailable <= 0)
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty",
|
||||
@@ -274,7 +274,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
var transferAmount = FixedPoint2.Min(drink.TransferAmount, drinkSolution.DrainAvailable);
|
||||
var drain = _solutionContainerSystem.Drain(uid, drinkSolution, transferAmount);
|
||||
var firstStomach = stomachs.FirstOrNull(
|
||||
stomach => _stomachSystem.CanTransferSolution(stomach.Comp.OwnerUid, drain));
|
||||
stomach => _stomachSystem.CanTransferSolution(((IComponent) stomach.Comp).Owner, drain));
|
||||
|
||||
// All stomach are full or can't handle whatever solution we have.
|
||||
if (firstStomach == null)
|
||||
@@ -299,7 +299,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
Filter.Pvs(userUid));
|
||||
|
||||
drain.DoEntityReaction(userUid, ReactionMethod.Ingestion);
|
||||
_stomachSystem.TryTransferSolution(firstStomach.Value.Comp.OwnerUid, drain, firstStomach.Value.Comp);
|
||||
_stomachSystem.TryTransferSolution(((IComponent) firstStomach.Value.Comp).Owner, drain, firstStomach.Value.Comp);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -378,7 +378,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
{
|
||||
args.Drink.InUse = false;
|
||||
var transferAmount = FixedPoint2.Min(args.Drink.TransferAmount, args.DrinkSolution.DrainAvailable);
|
||||
var drained = _solutionContainerSystem.Drain(args.Drink.OwnerUid, args.DrinkSolution, transferAmount);
|
||||
var drained = _solutionContainerSystem.Drain(((IComponent) args.Drink).Owner, args.DrinkSolution, transferAmount);
|
||||
|
||||
if (!_bodySystem.TryGetComponentsOnMechanisms<StomachComponent>(uid, out var stomachs, body))
|
||||
{
|
||||
@@ -390,7 +390,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
}
|
||||
|
||||
var firstStomach = stomachs.FirstOrNull(
|
||||
stomach => _stomachSystem.CanTransferSolution(stomach.Comp.OwnerUid, drained));
|
||||
stomach => _stomachSystem.CanTransferSolution(((IComponent) stomach.Comp).Owner, drained));
|
||||
|
||||
// All stomach are full or can't handle whatever solution we have.
|
||||
if (firstStomach == null)
|
||||
@@ -417,7 +417,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
SoundSystem.Play(Filter.Pvs(uid), args.Drink.UseSound.GetSound(), uid, AudioParams.Default.WithVolume(-2f));
|
||||
|
||||
drained.DoEntityReaction(uid, ReactionMethod.Ingestion);
|
||||
_stomachSystem.TryTransferSolution(firstStomach.Value.Comp.OwnerUid, drained, firstStomach.Value.Comp);
|
||||
_stomachSystem.TryTransferSolution(((IComponent) firstStomach.Value.Comp).Owner, drained, firstStomach.Value.Comp);
|
||||
}
|
||||
|
||||
private void OnForceDrinkCancelled(ForceDrinkCancelledEvent args)
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
var transferAmount = component.TransferAmount != null ? FixedPoint2.Min((FixedPoint2) component.TransferAmount, solution.CurrentVolume) : solution.CurrentVolume;
|
||||
var split = _solutionContainerSystem.SplitSolution(uid, solution, transferAmount);
|
||||
var firstStomach = stomachs.FirstOrNull(
|
||||
stomach => _stomachSystem.CanTransferSolution(stomach.Comp.OwnerUid, split));
|
||||
stomach => _stomachSystem.CanTransferSolution(((IComponent) stomach.Comp).Owner, split));
|
||||
|
||||
if (firstStomach == null)
|
||||
{
|
||||
@@ -169,7 +169,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
|
||||
// TODO: Account for partial transfer.
|
||||
split.DoEntityReaction(userUid, ReactionMethod.Ingestion);
|
||||
_stomachSystem.TryTransferSolution(firstStomach.Value.Comp.OwnerUid, split, firstStomach.Value.Comp);
|
||||
_stomachSystem.TryTransferSolution(((IComponent) firstStomach.Value.Comp).Owner, split, firstStomach.Value.Comp);
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(userUid), component.UseSound.GetSound(), userUid, AudioParams.Default.WithVolume(-1f));
|
||||
_popupSystem.PopupEntity(Loc.GetString(component.EatMessage, ("food", component.Owner)), userUid, Filter.Entities(userUid));
|
||||
@@ -177,7 +177,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
// Try to break all used utensils
|
||||
foreach (var utensil in usedUtensils)
|
||||
{
|
||||
_utensilSystem.TryBreak(utensil.OwnerUid, userUid);
|
||||
_utensilSystem.TryBreak(((IComponent) utensil).Owner, userUid);
|
||||
}
|
||||
|
||||
if (component.UsesRemaining > 0)
|
||||
@@ -186,7 +186,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(component.TrashPrototype))
|
||||
EntityManager.QueueDeleteEntity(component.OwnerUid);
|
||||
EntityManager.QueueDeleteEntity(((IComponent) component).Owner);
|
||||
else
|
||||
DeleteAndSpawnTrash(component, userUid);
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
EntityManager.TryGetComponent(userUid.Value, out HandsComponent? handsComponent) &&
|
||||
handsComponent.IsHolding(component.Owner))
|
||||
{
|
||||
EntityManager.DeleteEntity(component.OwnerUid);
|
||||
EntityManager.DeleteEntity(((IComponent) component).Owner);
|
||||
|
||||
// Put the trash in the user's hand
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(finisher, out ItemComponent? item) &&
|
||||
@@ -215,7 +215,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
return;
|
||||
}
|
||||
|
||||
EntityManager.QueueDeleteEntity(component.OwnerUid);
|
||||
EntityManager.QueueDeleteEntity(((IComponent) component).Owner);
|
||||
}
|
||||
|
||||
private void AddEatVerb(EntityUid uid, FoodComponent component, GetInteractionVerbsEvent ev)
|
||||
@@ -313,9 +313,9 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
? FixedPoint2.Min((FixedPoint2) args.Food.TransferAmount, args.FoodSolution.CurrentVolume)
|
||||
: args.FoodSolution.CurrentVolume;
|
||||
|
||||
var split = _solutionContainerSystem.SplitSolution(args.Food.OwnerUid, args.FoodSolution, transferAmount);
|
||||
var split = _solutionContainerSystem.SplitSolution(((IComponent) args.Food).Owner, args.FoodSolution, transferAmount);
|
||||
var firstStomach = stomachs.FirstOrNull(
|
||||
stomach => _stomachSystem.CanTransferSolution(stomach.Comp.OwnerUid, split));
|
||||
stomach => _stomachSystem.CanTransferSolution(((IComponent) stomach.Comp).Owner, split));
|
||||
|
||||
if (firstStomach == null)
|
||||
{
|
||||
@@ -325,7 +325,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
}
|
||||
|
||||
split.DoEntityReaction(uid, ReactionMethod.Ingestion);
|
||||
_stomachSystem.TryTransferSolution(firstStomach.Value.Comp.OwnerUid, split, firstStomach.Value.Comp);
|
||||
_stomachSystem.TryTransferSolution(((IComponent) firstStomach.Value.Comp).Owner, split, firstStomach.Value.Comp);
|
||||
|
||||
EntityManager.TryGetComponent(uid, out MetaDataComponent? targetMeta);
|
||||
var targetName = targetMeta?.EntityName ?? string.Empty;
|
||||
@@ -344,14 +344,14 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
// Try to break all used utensils
|
||||
foreach (var utensil in args.Utensils)
|
||||
{
|
||||
_utensilSystem.TryBreak(utensil.OwnerUid, args.User);
|
||||
_utensilSystem.TryBreak(((IComponent) utensil).Owner, args.User);
|
||||
}
|
||||
|
||||
if (args.Food.UsesRemaining > 0)
|
||||
return;
|
||||
|
||||
if (string.IsNullOrEmpty(args.Food.TrashPrototype))
|
||||
EntityManager.QueueDeleteEntity(args.Food.OwnerUid);
|
||||
EntityManager.QueueDeleteEntity(((IComponent) args.Food).Owner);
|
||||
else
|
||||
DeleteAndSpawnTrash(args.Food, args.User);
|
||||
}
|
||||
@@ -377,7 +377,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
DeleteAndSpawnTrash(food);
|
||||
|
||||
var firstStomach = stomachs.FirstOrNull(
|
||||
stomach => _stomachSystem.CanTransferSolution(stomach.Comp.OwnerUid, foodSolution));
|
||||
stomach => _stomachSystem.CanTransferSolution(((IComponent) stomach.Comp).Owner, foodSolution));
|
||||
|
||||
if (firstStomach == null)
|
||||
return;
|
||||
@@ -395,11 +395,11 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
_popupSystem.PopupEntity(Loc.GetString(food.EatMessage), target, filter);
|
||||
|
||||
foodSolution.DoEntityReaction(uid, ReactionMethod.Ingestion);
|
||||
_stomachSystem.TryTransferSolution(firstStomach.Value.Comp.OwnerUid, foodSolution, firstStomach.Value.Comp);
|
||||
_stomachSystem.TryTransferSolution(((IComponent) firstStomach.Value.Comp).Owner, foodSolution, firstStomach.Value.Comp);
|
||||
SoundSystem.Play(Filter.Pvs(target), food.UseSound.GetSound(), target, AudioParams.Default.WithVolume(-1f));
|
||||
|
||||
if (string.IsNullOrEmpty(food.TrashPrototype))
|
||||
EntityManager.QueueDeleteEntity(food.OwnerUid);
|
||||
EntityManager.QueueDeleteEntity(((IComponent) food).Owner);
|
||||
else
|
||||
DeleteAndSpawnTrash(food);
|
||||
}
|
||||
@@ -470,7 +470,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
|
||||
// check helmets. Note that not all helmets cover the face.
|
||||
if (inventory.TryGetSlotItem(EquipmentSlotDefines.Slots.HEAD, out ItemComponent? head) &&
|
||||
EntityManager.TryGetComponent(head.OwnerUid, out TagComponent tag) &&
|
||||
EntityManager.TryGetComponent(((IComponent) head).Owner, out TagComponent tag) &&
|
||||
tag.HasTag("ConcealsFace"))
|
||||
{
|
||||
blockingEntity = head.OwnerUid;
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace Content.Server.Physics.Controllers
|
||||
// then do the movement input once for it.
|
||||
foreach (var (shuttle, pilots) in _shuttlePilots)
|
||||
{
|
||||
if (shuttle.Paused || !EntityManager.TryGetComponent(shuttle.OwnerUid, out PhysicsComponent? body)) continue;
|
||||
if (shuttle.Paused || !EntityManager.TryGetComponent(((IComponent) shuttle).Owner, out PhysicsComponent? body)) continue;
|
||||
|
||||
// Collate movement linear and angular inputs together
|
||||
var linearInput = Vector2.Zero;
|
||||
@@ -131,7 +131,7 @@ namespace Content.Server.Physics.Controllers
|
||||
|
||||
if (sprint.Equals(Vector2.Zero)) continue;
|
||||
|
||||
var offsetRotation = EntityManager.GetComponent<TransformComponent>(console.OwnerUid).LocalRotation;
|
||||
var offsetRotation = EntityManager.GetComponent<TransformComponent>(((IComponent) console).Owner).LocalRotation;
|
||||
|
||||
linearInput += offsetRotation.RotateVec(new Vector2(0f, sprint.Y));
|
||||
angularInput += sprint.X;
|
||||
@@ -153,7 +153,7 @@ namespace Content.Server.Physics.Controllers
|
||||
|
||||
if (sprint.Equals(Vector2.Zero)) continue;
|
||||
|
||||
var offsetRotation = EntityManager.GetComponent<TransformComponent>(console.OwnerUid).LocalRotation;
|
||||
var offsetRotation = EntityManager.GetComponent<TransformComponent>(((IComponent) console).Owner).LocalRotation;
|
||||
sprint = offsetRotation.RotateVec(sprint);
|
||||
|
||||
linearInput += sprint;
|
||||
@@ -180,7 +180,7 @@ namespace Content.Server.Physics.Controllers
|
||||
var angle = linearInput.ToWorldAngle();
|
||||
var linearDir = angle.GetDir();
|
||||
var dockFlag = linearDir.AsFlag();
|
||||
var shuttleNorth = EntityManager.GetComponent<TransformComponent>(body.OwnerUid).WorldRotation.ToWorldVec();
|
||||
var shuttleNorth = EntityManager.GetComponent<TransformComponent>(((IComponent) body).Owner).WorldRotation.ToWorldVec();
|
||||
|
||||
// Won't just do cardinal directions.
|
||||
foreach (DirectionFlag dir in Enum.GetValues(typeof(DirectionFlag)))
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace Content.Server.PneumaticCannon
|
||||
if (storage.StoredEntities == null) return;
|
||||
if (storage.StoredEntities.Count == 0)
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(comp.OwnerUid), "/Audio/Weapons/click.ogg", comp.OwnerUid, AudioParams.Default);
|
||||
SoundSystem.Play(Filter.Pvs(((IComponent) comp).Owner), "/Audio/Weapons/click.ogg", ((IComponent) comp).Owner, AudioParams.Default);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ namespace Content.Server.PneumaticCannon
|
||||
{
|
||||
data.User.PopupMessage(Loc.GetString("pneumatic-cannon-component-fire-no-gas",
|
||||
("cannon", comp.Owner)));
|
||||
SoundSystem.Play(Filter.Pvs(comp.OwnerUid), "/Audio/Items/hiss.ogg", comp.OwnerUid, AudioParams.Default);
|
||||
SoundSystem.Play(Filter.Pvs(((IComponent) comp).Owner), "/Audio/Items/hiss.ogg", ((IComponent) comp).Owner, AudioParams.Default);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ namespace Content.Server.PneumaticCannon
|
||||
IEntity ent = _random.Pick(storage.StoredEntities);
|
||||
storage.Remove(ent);
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(data.User), comp.FireSound.GetSound(), comp.OwnerUid, AudioParams.Default);
|
||||
SoundSystem.Play(Filter.Pvs(data.User), comp.FireSound.GetSound(), ((IComponent) comp).Owner, AudioParams.Default);
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<CameraRecoilComponent?>(data.User, out var recoil))
|
||||
{
|
||||
recoil.Kick(Vector2.One * data.Strength);
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
{
|
||||
// No point resetting what the receiver is doing if it's deleting, plus significant perf savings
|
||||
// in not doing needless lookups
|
||||
if (EntityManager.GetComponent<MetaDataComponent>(receiver.OwnerUid).EntityLifeStage >
|
||||
if (EntityManager.GetComponent<MetaDataComponent>(((IComponent) receiver).Owner).EntityLifeStage >
|
||||
EntityLifeStage.MapInitialized) continue;
|
||||
|
||||
TryFindAndSetProvider(receiver);
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace Content.Server.PowerCell.Components
|
||||
var light = (int) Math.Ceiling(Math.Sqrt(CurrentCharge) / 30);
|
||||
|
||||
CurrentCharge = 0;
|
||||
EntitySystem.Get<ExplosionSystem>().SpawnExplosion(OwnerUid, 0, heavy, light, light*2);
|
||||
EntitySystem.Get<ExplosionSystem>().SpawnExplosion(((IComponent) this).Owner, 0, heavy, light, light*2);
|
||||
IoCManager.Resolve<IEntityManager>().DeleteEntity((EntityUid) Owner);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,11 +33,11 @@ namespace Content.Server.Shuttles.Components
|
||||
|
||||
if (!_enabled)
|
||||
{
|
||||
system.DisableThruster(OwnerUid, this);
|
||||
system.DisableThruster(((IComponent) this).Owner, this);
|
||||
}
|
||||
else if (system.CanEnable(OwnerUid, this))
|
||||
else if (system.CanEnable(((IComponent) this).Owner, this))
|
||||
{
|
||||
system.EnableThruster(OwnerUid, this);
|
||||
system.EnableThruster(((IComponent) this).Owner, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
if (dockingFixture == null)
|
||||
{
|
||||
DebugTools.Assert(false);
|
||||
Logger.ErrorS("docking", $"Found null fixture on {EntityManager.GetEntity(body.OwnerUid)}");
|
||||
Logger.ErrorS("docking", $"Found null fixture on {EntityManager.GetEntity(((IComponent) body).Owner)}");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
if (dockB == null || dockA.DockJoint == null)
|
||||
{
|
||||
DebugTools.Assert(false);
|
||||
Logger.Error("docking", $"Tried to cleanup {dockA.OwnerUid} but not docked?");
|
||||
Logger.Error("docking", $"Tried to cleanup {((IComponent) dockA).Owner} but not docked?");
|
||||
|
||||
dockA.DockedWith = null;
|
||||
if (dockA.DockJoint != null)
|
||||
@@ -202,8 +202,8 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
dockA.DockedWith = null;
|
||||
|
||||
// If these grids are ever invalid then need to look at fixing ordering for unanchored events elsewhere.
|
||||
var gridAUid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(dockA.OwnerUid).GridID).GridEntityId;
|
||||
var gridBUid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(dockB.OwnerUid).GridID).GridEntityId;
|
||||
var gridAUid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(((IComponent) dockA).Owner).GridID).GridEntityId;
|
||||
var gridBUid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(((IComponent) dockB).Owner).GridID).GridEntityId;
|
||||
|
||||
var msg = new UndockEvent
|
||||
{
|
||||
@@ -213,8 +213,8 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
GridBUid = gridBUid,
|
||||
};
|
||||
|
||||
EntityManager.EventBus.RaiseLocalEvent(dockA.OwnerUid, msg, false);
|
||||
EntityManager.EventBus.RaiseLocalEvent(dockB.OwnerUid, msg, false);
|
||||
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockA).Owner, msg, false);
|
||||
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockB).Owner, msg, false);
|
||||
EntityManager.EventBus.RaiseEvent(EventSource.Local, msg);
|
||||
}
|
||||
|
||||
@@ -310,8 +310,8 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
|
||||
// We could also potentially use a prismatic joint? Depending if we want clamps that can extend or whatever
|
||||
|
||||
var dockAXform = EntityManager.GetComponent<TransformComponent>(dockA.OwnerUid);
|
||||
var dockBXform = EntityManager.GetComponent<TransformComponent>(dockB.OwnerUid);
|
||||
var dockAXform = EntityManager.GetComponent<TransformComponent>(((IComponent) dockA).Owner);
|
||||
var dockBXform = EntityManager.GetComponent<TransformComponent>(((IComponent) dockB).Owner);
|
||||
|
||||
var gridA = _mapManager.GetGrid(dockAXform.GridID).GridEntityId;
|
||||
var gridB = _mapManager.GetGrid(dockBXform.GridID).GridEntityId;
|
||||
@@ -326,7 +326,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
|
||||
// These need playing around with
|
||||
// Could also potentially have collideconnected false and stiffness 0 but it was a bit more suss???
|
||||
var joint = _jointSystem.CreateWeldJoint(gridA, gridB, DockingJoint + dockA.OwnerUid);
|
||||
var joint = _jointSystem.CreateWeldJoint(gridA, gridB, DockingJoint + ((IComponent) dockA).Owner);
|
||||
|
||||
var gridAXform = EntityManager.GetComponent<TransformComponent>(gridA);
|
||||
var gridBXform = EntityManager.GetComponent<TransformComponent>(gridB);
|
||||
@@ -346,13 +346,13 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
dockA.DockJoint = joint;
|
||||
dockB.DockJoint = joint;
|
||||
|
||||
if (EntityManager.TryGetComponent(dockA.OwnerUid, out ServerDoorComponent? doorA))
|
||||
if (EntityManager.TryGetComponent(((IComponent) dockA).Owner, out ServerDoorComponent? doorA))
|
||||
{
|
||||
doorA.ChangeAirtight = false;
|
||||
doorA.Open();
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(dockB.OwnerUid, out ServerDoorComponent? doorB))
|
||||
if (EntityManager.TryGetComponent(((IComponent) dockB).Owner, out ServerDoorComponent? doorB))
|
||||
{
|
||||
doorB.ChangeAirtight = false;
|
||||
doorB.Open();
|
||||
@@ -366,8 +366,8 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
GridBUid = gridB,
|
||||
};
|
||||
|
||||
EntityManager.EventBus.RaiseLocalEvent(dockA.OwnerUid, msg, false);
|
||||
EntityManager.EventBus.RaiseLocalEvent(dockB.OwnerUid, msg, false);
|
||||
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockA).Owner, msg, false);
|
||||
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockB).Owner, msg, false);
|
||||
EntityManager.EventBus.RaiseEvent(EventSource.Local, msg);
|
||||
}
|
||||
|
||||
@@ -376,8 +376,8 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
/// </summary>
|
||||
private void TryDock(DockingComponent dockA, DockingComponent dockB)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(dockA.OwnerUid, out PhysicsComponent? bodyA) ||
|
||||
!EntityManager.TryGetComponent(dockB.OwnerUid, out PhysicsComponent? bodyB) ||
|
||||
if (!EntityManager.TryGetComponent(((IComponent) dockA).Owner, out PhysicsComponent? bodyA) ||
|
||||
!EntityManager.TryGetComponent(((IComponent) dockB).Owner, out PhysicsComponent? bodyB) ||
|
||||
!dockA.Enabled ||
|
||||
!dockB.Enabled)
|
||||
{
|
||||
@@ -423,17 +423,17 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
if (dock.DockedWith == null)
|
||||
{
|
||||
DebugTools.Assert(false);
|
||||
Logger.ErrorS("docking", $"Tried to undock {dock.OwnerUid} but not docked with anything?");
|
||||
Logger.ErrorS("docking", $"Tried to undock {((IComponent) dock).Owner} but not docked with anything?");
|
||||
return;
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(dock.OwnerUid, out ServerDoorComponent? doorA))
|
||||
if (EntityManager.TryGetComponent(((IComponent) dock).Owner, out ServerDoorComponent? doorA))
|
||||
{
|
||||
doorA.ChangeAirtight = true;
|
||||
doorA.Close();
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(dock.DockedWith.OwnerUid, out ServerDoorComponent? doorB))
|
||||
if (EntityManager.TryGetComponent(((IComponent) dock.DockedWith).Owner, out ServerDoorComponent? doorB))
|
||||
{
|
||||
doorB.ChangeAirtight = true;
|
||||
doorB.Close();
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
{
|
||||
if (comp.Console == null) continue;
|
||||
|
||||
if (!_blocker.CanInteract(comp.OwnerUid))
|
||||
if (!_blocker.CanInteract(((IComponent) comp).Owner))
|
||||
{
|
||||
toRemove.Add(comp);
|
||||
}
|
||||
|
||||
@@ -397,14 +397,14 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
if (args.OurFixture.ID != BurnFixture) return;
|
||||
|
||||
_activeThrusters.Add(component);
|
||||
component.Colliding.Add(args.OtherFixture.Body.OwnerUid);
|
||||
component.Colliding.Add(((IComponent) args.OtherFixture.Body).Owner);
|
||||
}
|
||||
|
||||
private void OnEndCollide(EntityUid uid, ThrusterComponent component, EndCollideEvent args)
|
||||
{
|
||||
if (args.OurFixture.ID != BurnFixture) return;
|
||||
|
||||
component.Colliding.Remove(args.OtherFixture.Body.OwnerUid);
|
||||
component.Colliding.Remove(((IComponent) args.OtherFixture.Body).Owner);
|
||||
|
||||
if (component.Colliding.Count == 0)
|
||||
{
|
||||
@@ -425,7 +425,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
|
||||
foreach (var comp in component.LinearThrusters[index])
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(comp.OwnerUid, out AppearanceComponent? appearanceComponent))
|
||||
if (!EntityManager.TryGetComponent(((IComponent) comp).Owner, out AppearanceComponent? appearanceComponent))
|
||||
continue;
|
||||
|
||||
comp.Firing = true;
|
||||
@@ -446,7 +446,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
|
||||
foreach (var comp in component.LinearThrusters[index])
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(comp.OwnerUid, out AppearanceComponent? appearanceComponent))
|
||||
if (!EntityManager.TryGetComponent(((IComponent) comp).Owner, out AppearanceComponent? appearanceComponent))
|
||||
continue;
|
||||
|
||||
comp.Firing = false;
|
||||
@@ -470,7 +470,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
{
|
||||
foreach (var comp in component.AngularThrusters)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(comp.OwnerUid, out AppearanceComponent? appearanceComponent))
|
||||
if (!EntityManager.TryGetComponent(((IComponent) comp).Owner, out AppearanceComponent? appearanceComponent))
|
||||
continue;
|
||||
|
||||
comp.Firing = true;
|
||||
@@ -481,7 +481,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
{
|
||||
foreach (var comp in component.AngularThrusters)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(comp.OwnerUid, out AppearanceComponent? appearanceComponent))
|
||||
if (!EntityManager.TryGetComponent(((IComponent) comp).Owner, out AppearanceComponent? appearanceComponent))
|
||||
continue;
|
||||
|
||||
comp.Firing = false;
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace Content.Server.Solar.EntitySystems
|
||||
|
||||
// Total coverage calculated; apply it to the panel.
|
||||
panel.Coverage = coverage;
|
||||
UpdateSupply(panel.OwnerUid, panel);
|
||||
UpdateSupply(((IComponent) panel).Owner, panel);
|
||||
}
|
||||
|
||||
public void UpdateSupply(
|
||||
|
||||
@@ -70,7 +70,8 @@ namespace Content.Server.StationEvents.Events
|
||||
// Account for split stations by just randomly picking a piece of it.
|
||||
var possibleTargets = _entityManager.EntityQuery<StationComponent>()
|
||||
.Where(x => x.Station == _target).ToArray();
|
||||
var stationEnt = _robustRandom.Pick(possibleTargets).OwnerUid;
|
||||
StationComponent tempQualifier = _robustRandom.Pick(possibleTargets);
|
||||
var stationEnt = ((IComponent) tempQualifier).Owner;
|
||||
|
||||
if (!_entityManager.TryGetComponent<IMapGridComponent>(stationEnt, out var grid))
|
||||
return;
|
||||
|
||||
@@ -225,7 +225,7 @@ namespace Content.Server.Storage.Components
|
||||
|
||||
var targetIsItem = IoCManager.Resolve<IEntityManager>().HasComponent<SharedItemComponent>(entity);
|
||||
var targetIsMob = IoCManager.Resolve<IEntityManager>().HasComponent<SharedBodyComponent>(entity);
|
||||
var storageIsItem = IoCManager.Resolve<IEntityManager>().HasComponent<SharedItemComponent>(OwnerUid);
|
||||
var storageIsItem = IoCManager.Resolve<IEntityManager>().HasComponent<SharedItemComponent>(((IComponent) this).Owner);
|
||||
|
||||
var allowedToEat = false;
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace Content.Server.Storage.Components
|
||||
|
||||
private void UpdateStorageVisualization()
|
||||
{
|
||||
if (!_entityManager.TryGetComponent(OwnerUid, out AppearanceComponent appearance))
|
||||
if (!_entityManager.TryGetComponent(((IComponent) this).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<ItemCounterComponent>(OwnerUid))
|
||||
if (_entityManager.HasComponent<ItemCounterComponent>(((IComponent) this).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: {OwnerUid}");
|
||||
DebugTools.Assert(storageComponent != this, $"Storage component contains itself!? Entity: {((IComponent) this).Owner}");
|
||||
storageComponent.UnsubscribeSession(session);
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace Content.Server.Tabletop
|
||||
return;
|
||||
};
|
||||
|
||||
var gamerUid = gamer.OwnerUid;
|
||||
var gamerUid = ((IComponent) gamer).Owner;
|
||||
|
||||
if (actor.PlayerSession.Status > SessionStatus.Connected || CanSeeTable(gamerUid, gamer.Tabletop)
|
||||
|| !StunnedOrNoHands(gamerUid))
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Content.Server.Temperature.Systems
|
||||
if (comp.Deleted || comp.Paused)
|
||||
continue;
|
||||
|
||||
ChangeDamage(comp.OwnerUid, comp);
|
||||
ChangeDamage(((IComponent) comp).Owner, comp);
|
||||
}
|
||||
|
||||
ShouldUpdateDamage.Clear();
|
||||
|
||||
@@ -91,10 +91,10 @@ namespace Content.Server.UserInterface
|
||||
// If we've gotten this far, fire a cancellable event that indicates someone is about to activate this.
|
||||
// This is so that stuff can require further conditions (like power).
|
||||
var oae = new ActivatableUIOpenAttemptEvent(user);
|
||||
RaiseLocalEvent(aui.OwnerUid, oae, false);
|
||||
RaiseLocalEvent(((IComponent) aui).Owner, oae, false);
|
||||
if (oae.Cancelled) return false;
|
||||
|
||||
SetCurrentSingleUser(aui.OwnerUid, actor.PlayerSession, aui);
|
||||
SetCurrentSingleUser(((IComponent) aui).Owner, actor.PlayerSession, aui);
|
||||
ui.Toggle(actor.PlayerSession);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ namespace Content.Server.Weapon.Melee
|
||||
foreach (var bloodstream in hitBloodstreams)
|
||||
{
|
||||
var individualInjection = solutionToInject.SplitSolution(volPerBloodstream);
|
||||
_bloodstreamSystem.TryAddToBloodstream(bloodstream.OwnerUid, individualInjection, bloodstream);
|
||||
_bloodstreamSystem.TryAddToBloodstream(((IComponent) bloodstream).Owner, individualInjection, bloodstream);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -365,7 +365,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(projectile).WorldRotation = projectileAngle + MathHelper.PiOver2;
|
||||
}
|
||||
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(OwnerUid, new GunShotEvent(firedProjectiles));
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new GunShotEvent(firedProjectiles));
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(ammo, new AmmoShotEvent(firedProjectiles));
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace Content.Shared.Actions.Components
|
||||
if (_holderActionsComponent == null) return;
|
||||
foreach (var (actionType, state) in _actions)
|
||||
{
|
||||
_holderActionsComponent.GrantOrUpdateItemAction(actionType, OwnerUid, state);
|
||||
_holderActionsComponent.GrantOrUpdateItemAction(actionType, ((IComponent) this).Owner, state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace Content.Shared.Actions.Components
|
||||
if (_holderActionsComponent == null) return;
|
||||
foreach (var (actionType, state) in _actions)
|
||||
{
|
||||
_holderActionsComponent.RevokeItemAction(actionType, OwnerUid);
|
||||
_holderActionsComponent.RevokeItemAction(actionType, ((IComponent) this).Owner);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace Content.Shared.Actions.Components
|
||||
if (!dirty) return;
|
||||
|
||||
_actions[actionType] = actionState;
|
||||
_holderActionsComponent?.GrantOrUpdateItemAction(actionType, OwnerUid, actionState);
|
||||
_holderActionsComponent?.GrantOrUpdateItemAction(actionType, ((IComponent) this).Owner, actionState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace Content.Shared.Body.Components
|
||||
|
||||
var argsAdded = new BodyPartAddedEventArgs(slot.Id, part);
|
||||
|
||||
EntitySystem.Get<SharedHumanoidAppearanceSystem>().BodyPartAdded(OwnerUid, argsAdded);
|
||||
EntitySystem.Get<SharedHumanoidAppearanceSystem>().BodyPartAdded(((IComponent) this).Owner, argsAdded);
|
||||
foreach (var component in IoCManager.Resolve<IEntityManager>().GetComponents<IBodyPartAdded>(Owner).ToArray())
|
||||
{
|
||||
component.BodyPartAdded(argsAdded);
|
||||
@@ -174,7 +174,7 @@ namespace Content.Shared.Body.Components
|
||||
var args = new BodyPartRemovedEventArgs(slot.Id, part);
|
||||
|
||||
|
||||
EntitySystem.Get<SharedHumanoidAppearanceSystem>().BodyPartRemoved(OwnerUid, args);
|
||||
EntitySystem.Get<SharedHumanoidAppearanceSystem>().BodyPartRemoved(((IComponent) this).Owner, args);
|
||||
foreach (var component in IoCManager.Resolve<IEntityManager>().GetComponents<IBodyPartRemoved>(Owner))
|
||||
{
|
||||
component.BodyPartRemoved(args);
|
||||
@@ -184,14 +184,14 @@ namespace Content.Shared.Body.Components
|
||||
if (part.PartType == BodyPartType.Leg &&
|
||||
GetPartsOfType(BodyPartType.Leg).ToArray().Length == 0)
|
||||
{
|
||||
EntitySystem.Get<StandingStateSystem>().Down(OwnerUid);
|
||||
EntitySystem.Get<StandingStateSystem>().Down(((IComponent) this).Owner);
|
||||
}
|
||||
|
||||
if (part.IsVital && SlotParts.Count(x => x.Value.PartType == part.PartType) == 0)
|
||||
{
|
||||
// TODO BODY SYSTEM KILL : Find a more elegant way of killing em than just dumping bloodloss damage.
|
||||
var damage = new DamageSpecifier(_prototypeManager.Index<DamageTypePrototype>("Bloodloss"), 300);
|
||||
EntitySystem.Get<DamageableSystem>().TryChangeDamage(part.OwnerUid, damage);
|
||||
EntitySystem.Get<DamageableSystem>().TryChangeDamage(((IComponent) part).Owner, damage);
|
||||
}
|
||||
|
||||
OnBodyChanged();
|
||||
@@ -468,7 +468,7 @@ namespace Content.Shared.Body.Components
|
||||
var i = 0;
|
||||
foreach (var (part, slot) in SlotParts)
|
||||
{
|
||||
parts[i] = (slot.Id, part.OwnerUid);
|
||||
parts[i] = (slot.Id, OwnerUid: ((IComponent) part).Owner);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ namespace Content.Shared.Body.Components
|
||||
|
||||
foreach (var mechanism in _mechanisms)
|
||||
{
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(mechanism.OwnerUid, new AddedToBodyEvent(body));
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(((IComponent) mechanism).Owner, new AddedToBodyEvent(body));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ namespace Content.Shared.Body.Components
|
||||
|
||||
foreach (var mechanism in _mechanisms)
|
||||
{
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(mechanism.OwnerUid, new RemovedFromBodyEvent(old));
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(((IComponent) mechanism).Owner, new RemovedFromBodyEvent(old));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@ namespace Content.Shared.Body.Components
|
||||
{
|
||||
if (old.Body == null)
|
||||
{
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(OwnerUid, new RemovedFromPartEvent(old));
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new RemovedFromPartEvent(old));
|
||||
}
|
||||
else
|
||||
{
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(OwnerUid, new RemovedFromPartInBodyEvent(old.Body, old));
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new RemovedFromPartInBodyEvent(old.Body, old));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,11 +49,11 @@ namespace Content.Shared.Body.Components
|
||||
{
|
||||
if (value.Body == null)
|
||||
{
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(OwnerUid, new AddedToPartEvent(value));
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new AddedToPartEvent(value));
|
||||
}
|
||||
else
|
||||
{
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(OwnerUid, new AddedToPartInBodyEvent(value.Body, value));
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new AddedToPartInBodyEvent(value.Body, value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace Content.Shared.Buckle
|
||||
|
||||
private void PreventCollision(EntityUid uid, SharedBuckleComponent component, PreventCollideEvent args)
|
||||
{
|
||||
if (args.BodyB.OwnerUid != component.LastEntityBuckledTo) return;
|
||||
if (args.BodyB.Owner != component.LastEntityBuckledTo) return;
|
||||
|
||||
component.IsOnStrapEntityThisFrame = true;
|
||||
if (component.Buckled || component.DontCollide)
|
||||
|
||||
@@ -75,9 +75,9 @@ namespace Content.Shared.Chemistry
|
||||
if (component.ModifierTimer > currentTime) continue;
|
||||
|
||||
_components.RemoveAt(i);
|
||||
EntityManager.RemoveComponent<MovespeedModifierMetabolismComponent>(component.OwnerUid);
|
||||
EntityManager.RemoveComponent<MovespeedModifierMetabolismComponent>(((IComponent) component).Owner);
|
||||
|
||||
_movespeed.RefreshMovementSpeedModifiers(component.OwnerUid);
|
||||
_movespeed.RefreshMovementSpeedModifiers(((IComponent) component).Owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace Content.Shared.Damage
|
||||
damage.DamageDict.Add(typeID, damageValue);
|
||||
}
|
||||
|
||||
var actual = EntitySystem.Get<DamageableSystem>().TryChangeDamage(OwnerUid, damage);
|
||||
var actual = EntitySystem.Get<DamageableSystem>().TryChangeDamage(((IComponent) this).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<DamageableSystem>().TryChangeDamage(OwnerUid, damage);
|
||||
var actual = EntitySystem.Get<DamageableSystem>().TryChangeDamage(((IComponent) this).Owner, damage);
|
||||
|
||||
// will logging handle nukes?
|
||||
if (actual != null && !actual.Empty)
|
||||
|
||||
@@ -128,9 +128,9 @@ namespace Content.Shared.Damage
|
||||
SetTotalDamage(component, component.Damage.Total, logChange);
|
||||
component.Dirty();
|
||||
|
||||
if (EntityManager.TryGetComponent<AppearanceComponent>(component.OwnerUid, out var appearance) && damageDelta != null)
|
||||
if (EntityManager.TryGetComponent<AppearanceComponent>(((IComponent) component).Owner, out var appearance) && damageDelta != null)
|
||||
appearance.SetData(DamageVisualizerKeys.DamageUpdateGroups, damageDelta.GetDamagePerGroup().Keys.ToList());
|
||||
RaiseLocalEvent(component.OwnerUid, new DamageChangedEvent(component, damageDelta, interruptsDoAfters), false);
|
||||
RaiseLocalEvent(((IComponent) component).Owner, new DamageChangedEvent(component, damageDelta, interruptsDoAfters), false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Content.Shared.Disposal
|
||||
|
||||
private void HandlePreventCollide(EntityUid uid, SharedDisposalUnitComponent component, PreventCollideEvent args)
|
||||
{
|
||||
var otherBody = args.BodyB.OwnerUid;
|
||||
var otherBody = args.BodyB.Owner;
|
||||
|
||||
// Items dropped shouldn't collide but items thrown should
|
||||
if (EntityManager.HasComponent<SharedItemComponent>(otherBody) &&
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Content.Shared.Friction
|
||||
if (body.Deleted ||
|
||||
prediction && !body.Predict ||
|
||||
body.BodyStatus == BodyStatus.InAir ||
|
||||
Mover.UseMobMovement(body.OwnerUid)) continue;
|
||||
Mover.UseMobMovement(((IComponent) body).Owner)) continue;
|
||||
|
||||
var surfaceFriction = GetTileFriction(body);
|
||||
var bodyModifier = IoCManager.Resolve<IEntityManager>().GetComponentOrNull<SharedTileFrictionModifier>(body.Owner)?.Modifier ?? 1.0f;
|
||||
|
||||
@@ -432,7 +432,7 @@ namespace Content.Shared.Hands.Components
|
||||
/// </summary>
|
||||
private bool PlayerCanDrop()
|
||||
{
|
||||
if (!IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ActionBlockerSystem>().CanDrop(OwnerUid))
|
||||
if (!IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ActionBlockerSystem>().CanDrop(((IComponent) this).Owner))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -291,7 +291,7 @@ namespace Content.Shared.MobState.Components
|
||||
{
|
||||
if (!current.HasValue)
|
||||
{
|
||||
old?.ExitState(OwnerUid, IoCManager.Resolve<IEntityManager>());
|
||||
old?.ExitState(((IComponent) this).Owner, IoCManager.Resolve<IEntityManager>());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -301,16 +301,16 @@ namespace Content.Shared.MobState.Components
|
||||
|
||||
if (state == old)
|
||||
{
|
||||
state.UpdateState(OwnerUid, threshold, IoCManager.Resolve<IEntityManager>());
|
||||
state.UpdateState(((IComponent) this).Owner, threshold, IoCManager.Resolve<IEntityManager>());
|
||||
return;
|
||||
}
|
||||
|
||||
old?.ExitState(OwnerUid, IoCManager.Resolve<IEntityManager>());
|
||||
old?.ExitState(((IComponent) this).Owner, IoCManager.Resolve<IEntityManager>());
|
||||
|
||||
CurrentState = state;
|
||||
|
||||
state.EnterState(OwnerUid, IoCManager.Resolve<IEntityManager>());
|
||||
state.UpdateState(OwnerUid, threshold, IoCManager.Resolve<IEntityManager>());
|
||||
state.EnterState(((IComponent) this).Owner, IoCManager.Resolve<IEntityManager>());
|
||||
state.UpdateState(((IComponent) this).Owner, threshold, IoCManager.Resolve<IEntityManager>());
|
||||
|
||||
var message = new MobStateChangedMessage(this, old, state);
|
||||
#pragma warning disable 618
|
||||
|
||||
@@ -36,7 +36,7 @@ public class SlowContactsSystem : EntitySystem
|
||||
|
||||
foreach (var colliding in _physics.GetCollidingEntities(physicsComponent))
|
||||
{
|
||||
var ent = colliding.OwnerUid;
|
||||
var ent = ((IComponent) colliding).Owner;
|
||||
if (!EntityManager.TryGetComponent<SlowContactsComponent>(ent, out var slowContactsComponent))
|
||||
continue;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class SlowContactsSystem : EntitySystem
|
||||
|
||||
private void OnEntityExit(EntityUid uid, SlowContactsComponent component, EndCollideEvent args)
|
||||
{
|
||||
var otherUid = args.OtherFixture.Body.OwnerUid;
|
||||
var otherUid = ((IComponent) args.OtherFixture.Body).Owner;
|
||||
if (!EntityManager.HasComponent<MovementSpeedModifierComponent>(otherUid)
|
||||
|| !EntityManager.HasComponent<SlowsOnContactComponent>(otherUid))
|
||||
return;
|
||||
@@ -64,7 +64,7 @@ public class SlowContactsSystem : EntitySystem
|
||||
|
||||
private void OnEntityEnter(EntityUid uid, SlowContactsComponent component, StartCollideEvent args)
|
||||
{
|
||||
var otherUid = args.OtherFixture.Body.OwnerUid;
|
||||
var otherUid = ((IComponent) args.OtherFixture.Body).Owner;
|
||||
if (!EntityManager.HasComponent<MovementSpeedModifierComponent>(otherUid))
|
||||
return;
|
||||
if (!_statusCapableInContact.ContainsKey(otherUid))
|
||||
|
||||
@@ -96,15 +96,15 @@ namespace Content.Shared.Movement
|
||||
protected void HandleMobMovement(IMoverComponent mover, PhysicsComponent physicsComponent,
|
||||
IMobMoverComponent mobMover)
|
||||
{
|
||||
DebugTools.Assert(!UsedMobMovement.ContainsKey(mover.OwnerUid));
|
||||
DebugTools.Assert(!UsedMobMovement.ContainsKey(mover.Owner));
|
||||
|
||||
if (!UseMobMovement(physicsComponent))
|
||||
{
|
||||
UsedMobMovement[mover.OwnerUid] = false;
|
||||
UsedMobMovement[mover.Owner] = false;
|
||||
return;
|
||||
}
|
||||
|
||||
UsedMobMovement[mover.OwnerUid] = true;
|
||||
UsedMobMovement[mover.Owner] = true;
|
||||
var transform = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(mover.Owner);
|
||||
var weightless = mover.Owner.IsWeightless(physicsComponent, mapManager: _mapManager, entityManager: _entityManager);
|
||||
var (walkDir, sprintDir) = mover.VelocityDir;
|
||||
@@ -167,7 +167,7 @@ namespace Content.Shared.Movement
|
||||
IoCManager.Resolve<IEntityManager>().HasComponent<MobStateComponent>(body.Owner) &&
|
||||
// If we're being pulled then don't mess with our velocity.
|
||||
(!IoCManager.Resolve<IEntityManager>().TryGetComponent(body.Owner, out SharedPullableComponent? pullable) || !pullable.BeingPulled) &&
|
||||
_blocker.CanMove(body.OwnerUid);
|
||||
_blocker.CanMove(((IComponent) body).Owner);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Content.Shared.Projectiles
|
||||
|
||||
private void PreventCollision(EntityUid uid, SharedProjectileComponent component, PreventCollideEvent args)
|
||||
{
|
||||
if (component.IgnoreShooter && args.BodyB.OwnerUid == component.Shooter)
|
||||
if (component.IgnoreShooter && args.BodyB.Owner == component.Shooter)
|
||||
{
|
||||
args.Cancel();
|
||||
return;
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Content.Shared.Pulling.Systems
|
||||
SharedPullerComponent component,
|
||||
PullStartedMessage args)
|
||||
{
|
||||
if (args.Puller.OwnerUid != uid)
|
||||
if (args.Puller.Owner != uid)
|
||||
return;
|
||||
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out SharedAlertsComponent? alerts))
|
||||
@@ -59,7 +59,7 @@ namespace Content.Shared.Pulling.Systems
|
||||
SharedPullerComponent component,
|
||||
PullStoppedMessage args)
|
||||
{
|
||||
if (args.Puller.OwnerUid != uid)
|
||||
if (args.Puller.Owner != uid)
|
||||
return;
|
||||
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out SharedAlertsComponent? alerts))
|
||||
@@ -75,7 +75,7 @@ namespace Content.Shared.Pulling.Systems
|
||||
|
||||
private void RefreshMovementSpeed(SharedPullerComponent component)
|
||||
{
|
||||
_movementSpeedModifierSystem.RefreshMovementSpeedModifiers(component.OwnerUid);
|
||||
_movementSpeedModifierSystem.RefreshMovementSpeedModifiers(((IComponent) component).Owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,10 +59,10 @@ namespace Content.Shared.Pulling
|
||||
// Messaging
|
||||
var message = new PullStoppedMessage(pullerPhysics, pullablePhysics);
|
||||
|
||||
RaiseLocalEvent(puller.OwnerUid, message, broadcast: false);
|
||||
RaiseLocalEvent(((IComponent) puller).Owner, message, broadcast: false);
|
||||
|
||||
if ((!IoCManager.Resolve<IEntityManager>().EntityExists(pullable.Owner) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(pullable.Owner).EntityLifeStage) <= EntityLifeStage.MapInitialized)
|
||||
RaiseLocalEvent(pullable.OwnerUid, message);
|
||||
RaiseLocalEvent(((IComponent) pullable).Owner, message);
|
||||
|
||||
// Networking
|
||||
puller.Dirty();
|
||||
@@ -106,7 +106,7 @@ namespace Content.Shared.Pulling
|
||||
var union = pullerPhysics.GetWorldAABB().Union(pullablePhysics.GetWorldAABB());
|
||||
var length = Math.Max(union.Size.X, union.Size.Y) * 0.75f;
|
||||
|
||||
pullable.PullJoint = _jointSystem.CreateDistanceJoint(pullablePhysics.OwnerUid, pullerPhysics.Owner, id:$"pull-joint-{pullablePhysics.Owner}");
|
||||
pullable.PullJoint = _jointSystem.CreateDistanceJoint(((IComponent) pullablePhysics).Owner, pullerPhysics.Owner, id:$"pull-joint-{pullablePhysics.Owner}");
|
||||
pullable.PullJoint.CollideConnected = false;
|
||||
// This maximum has to be there because if the object is constrained too closely, the clamping goes backwards and asserts.
|
||||
pullable.PullJoint.MaxLength = Math.Max(1.0f, length);
|
||||
@@ -117,8 +117,8 @@ namespace Content.Shared.Pulling
|
||||
// Messaging
|
||||
var message = new PullStartedMessage(pullerPhysics, pullablePhysics);
|
||||
|
||||
RaiseLocalEvent(puller.OwnerUid, message, broadcast: false);
|
||||
RaiseLocalEvent(pullable.OwnerUid, message);
|
||||
RaiseLocalEvent(((IComponent) puller).Owner, message, broadcast: false);
|
||||
RaiseLocalEvent(((IComponent) pullable).Owner, message);
|
||||
|
||||
// Networking
|
||||
puller.Dirty();
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Content.Shared.Pulling
|
||||
}
|
||||
|
||||
var msg = new StopPullingEvent(user);
|
||||
RaiseLocalEvent(pullable.OwnerUid, msg);
|
||||
RaiseLocalEvent(((IComponent) pullable).Owner, msg);
|
||||
|
||||
if (msg.Cancelled) return false;
|
||||
|
||||
@@ -173,14 +173,14 @@ namespace Content.Shared.Pulling
|
||||
|
||||
var pullAttempt = new PullAttemptMessage(pullerPhysics, pullablePhysics);
|
||||
|
||||
RaiseLocalEvent(puller.OwnerUid, pullAttempt, broadcast: false);
|
||||
RaiseLocalEvent(((IComponent) puller).Owner, pullAttempt, broadcast: false);
|
||||
|
||||
if (pullAttempt.Cancelled)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
RaiseLocalEvent(pullable.OwnerUid, pullAttempt);
|
||||
RaiseLocalEvent(((IComponent) pullable).Owner, pullAttempt);
|
||||
|
||||
if (pullAttempt.Cancelled)
|
||||
{
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace Content.Shared.Pulling
|
||||
// Raise a "you are being pulled" alert if the pulled entity has alerts.
|
||||
private static void PullableHandlePullStarted(EntityUid uid, SharedPullableComponent component, PullStartedMessage args)
|
||||
{
|
||||
if (args.Pulled.OwnerUid != uid)
|
||||
if (args.Pulled.Owner != uid)
|
||||
return;
|
||||
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out SharedAlertsComponent? alerts))
|
||||
@@ -111,7 +111,7 @@ namespace Content.Shared.Pulling
|
||||
|
||||
private static void PullableHandlePullStopped(EntityUid uid, SharedPullableComponent component, PullStoppedMessage args)
|
||||
{
|
||||
if (args.Pulled.OwnerUid != uid)
|
||||
if (args.Pulled.Owner != uid)
|
||||
return;
|
||||
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out SharedAlertsComponent? alerts))
|
||||
|
||||
@@ -50,7 +50,10 @@ namespace Content.Shared.Shuttles.Components
|
||||
|
||||
public override ComponentState GetComponentState()
|
||||
{
|
||||
return new PilotComponentState(Console?.OwnerUid);
|
||||
if(Console == null)
|
||||
return new
|
||||
|
||||
return new PilotComponentState(((IComponent) Console).Owner);
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Content.Shared.Slippery
|
||||
|
||||
private void HandleCollide(EntityUid uid, SlipperyComponent component, StartCollideEvent args)
|
||||
{
|
||||
var otherUid = args.OtherFixture.Body.OwnerUid;
|
||||
var otherUid = ((IComponent) args.OtherFixture.Body).Owner;
|
||||
|
||||
if (!CanSlip(component, otherUid)) return;
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Content.Shared.Slippery
|
||||
|
||||
private bool TrySlip(SlipperyComponent component, IPhysBody ourBody, IPhysBody otherBody)
|
||||
{
|
||||
if (!CanSlip(component, otherBody.OwnerUid)) return false;
|
||||
if (!CanSlip(component, otherBody.Owner)) return false;
|
||||
|
||||
if (otherBody.LinearVelocity.Length < component.RequiredSlipSpeed)
|
||||
{
|
||||
@@ -89,14 +89,14 @@ namespace Content.Shared.Slippery
|
||||
}
|
||||
|
||||
var ev = new SlipAttemptEvent();
|
||||
RaiseLocalEvent(otherBody.OwnerUid, ev, false);
|
||||
RaiseLocalEvent(otherBody.Owner, ev, false);
|
||||
if (ev.Cancelled)
|
||||
return false;
|
||||
|
||||
otherBody.LinearVelocity *= component.LaunchForwardsMultiplier;
|
||||
|
||||
_stunSystem.TryParalyze(otherBody.OwnerUid, TimeSpan.FromSeconds(5));
|
||||
component.Slipped.Add(otherBody.OwnerUid);
|
||||
_stunSystem.TryParalyze(otherBody.Owner, TimeSpan.FromSeconds(5));
|
||||
component.Slipped.Add(otherBody.Owner);
|
||||
component.Dirty();
|
||||
|
||||
PlaySound(component);
|
||||
|
||||
Reference in New Issue
Block a user