Makes many things use OwnerUid instead of Owner.Uid
This commit is contained in:
@@ -125,7 +125,7 @@ namespace Content.Server.Construction.Components
|
||||
if (Owner.TryGetComponent<ConstructionComponent>(out var construction))
|
||||
{
|
||||
// Attempt to set pathfinding to the machine node...
|
||||
EntitySystem.Get<ConstructionSystem>().SetPathfindingTarget(Owner.Uid, "machine", construction);
|
||||
EntitySystem.Get<ConstructionSystem>().SetPathfindingTarget(OwnerUid, "machine", construction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace Content.Server.Construction.Components
|
||||
if (Owner.TryGetComponent(out ConstructionComponent? construction))
|
||||
{
|
||||
// So prying the components off works correctly.
|
||||
EntitySystem.Get<ConstructionSystem>().ResetEdge(Owner.Uid, construction);
|
||||
EntitySystem.Get<ConstructionSystem>().ResetEdge(OwnerUid, construction);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace Content.Shared.Actions.Components
|
||||
if (_holderActionsComponent == null) return;
|
||||
foreach (var (actionType, state) in _actions)
|
||||
{
|
||||
_holderActionsComponent.GrantOrUpdateItemAction(actionType, Owner.Uid, state);
|
||||
_holderActionsComponent.GrantOrUpdateItemAction(actionType, OwnerUid, state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace Content.Shared.Actions.Components
|
||||
if (_holderActionsComponent == null) return;
|
||||
foreach (var (actionType, state) in _actions)
|
||||
{
|
||||
_holderActionsComponent.RevokeItemAction(actionType, Owner.Uid);
|
||||
_holderActionsComponent.RevokeItemAction(actionType, OwnerUid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace Content.Shared.Actions.Components
|
||||
if (!dirty) return;
|
||||
|
||||
_actions[actionType] = actionState;
|
||||
_holderActionsComponent?.GrantOrUpdateItemAction(actionType, Owner.Uid, actionState);
|
||||
_holderActionsComponent?.GrantOrUpdateItemAction(actionType, OwnerUid, actionState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace Content.Shared.Body.Components
|
||||
|
||||
var argsAdded = new BodyPartAddedEventArgs(slot.Id, part);
|
||||
|
||||
EntitySystem.Get<SharedHumanoidAppearanceSystem>().BodyPartAdded(Owner.Uid, argsAdded);
|
||||
EntitySystem.Get<SharedHumanoidAppearanceSystem>().BodyPartAdded(OwnerUid, argsAdded);
|
||||
foreach (var component in Owner.GetAllComponents<IBodyPartAdded>().ToArray())
|
||||
{
|
||||
component.BodyPartAdded(argsAdded);
|
||||
@@ -180,7 +180,7 @@ namespace Content.Shared.Body.Components
|
||||
var args = new BodyPartRemovedEventArgs(slot.Id, part);
|
||||
|
||||
|
||||
EntitySystem.Get<SharedHumanoidAppearanceSystem>().BodyPartRemoved(Owner.Uid, args);
|
||||
EntitySystem.Get<SharedHumanoidAppearanceSystem>().BodyPartRemoved(OwnerUid, args);
|
||||
foreach (var component in Owner.GetAllComponents<IBodyPartRemoved>())
|
||||
{
|
||||
component.BodyPartRemoved(args);
|
||||
@@ -190,14 +190,14 @@ namespace Content.Shared.Body.Components
|
||||
if (part.PartType == BodyPartType.Leg &&
|
||||
GetPartsOfType(BodyPartType.Leg).ToArray().Length == 0)
|
||||
{
|
||||
EntitySystem.Get<StandingStateSystem>().Down(Owner.Uid);
|
||||
EntitySystem.Get<StandingStateSystem>().Down(OwnerUid);
|
||||
}
|
||||
|
||||
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.Owner.Uid, damage);
|
||||
EntitySystem.Get<DamageableSystem>().TryChangeDamage(part.OwnerUid, damage);
|
||||
}
|
||||
|
||||
OnBodyChanged();
|
||||
@@ -556,7 +556,7 @@ namespace Content.Shared.Body.Components
|
||||
var i = 0;
|
||||
foreach (var (part, slot) in SlotParts)
|
||||
{
|
||||
parts[i] = (slot.Id, part.Owner.Uid);
|
||||
parts[i] = (slot.Id, part.OwnerUid);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace Content.Shared.Body.Part
|
||||
var i = 0;
|
||||
foreach (var mechanism in _mechanisms)
|
||||
{
|
||||
mechanismIds[i] = mechanism.Owner.Uid;
|
||||
mechanismIds[i] = mechanism.OwnerUid;
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace Content.Shared.Buckle
|
||||
|
||||
private void PreventCollision(EntityUid uid, SharedBuckleComponent component, PreventCollideEvent args)
|
||||
{
|
||||
if (args.BodyB.Owner.Uid != component.LastEntityBuckledTo) return;
|
||||
if (args.BodyB.OwnerUid != component.LastEntityBuckledTo) return;
|
||||
|
||||
component.IsOnStrapEntityThisFrame = true;
|
||||
if (component.Buckled || component.DontCollide)
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace Content.Shared.Containers.ItemSlots
|
||||
{
|
||||
// insert item
|
||||
slot.ContainerSlot.Insert(item);
|
||||
RaiseLocalEvent(itemSlots.Owner.Uid, new ItemSlotChangedEvent(itemSlots, slotName, slot));
|
||||
RaiseLocalEvent(itemSlots.OwnerUid, new ItemSlotChangedEvent(itemSlots, slotName, slot));
|
||||
|
||||
// play sound
|
||||
if (slot.InsertSound != null)
|
||||
@@ -248,7 +248,7 @@ namespace Content.Shared.Containers.ItemSlots
|
||||
if (slot.EjectSound != null)
|
||||
SoundSystem.Play(Filter.Pvs(itemSlots.Owner), slot.EjectSound.GetSound(), itemSlots.Owner);
|
||||
|
||||
RaiseLocalEvent(itemSlots.Owner.Uid, new ItemSlotChangedEvent(itemSlots, slotName, slot));
|
||||
RaiseLocalEvent(itemSlots.OwnerUid, new ItemSlotChangedEvent(itemSlots, slotName, slot));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Content.Shared.Damage
|
||||
damage.DamageDict.Add(typeID, damageValue);
|
||||
}
|
||||
|
||||
EntitySystem.Get<DamageableSystem>().TryChangeDamage(Owner.Uid, damage);
|
||||
EntitySystem.Get<DamageableSystem>().TryChangeDamage(OwnerUid, damage);
|
||||
}
|
||||
|
||||
// TODO EXPLOSION Remove this.
|
||||
@@ -113,7 +113,7 @@ namespace Content.Shared.Damage
|
||||
damage.DamageDict.Add(typeID, damageValue);
|
||||
}
|
||||
|
||||
EntitySystem.Get<DamageableSystem>().TryChangeDamage(Owner.Uid, damage);
|
||||
EntitySystem.Get<DamageableSystem>().TryChangeDamage(OwnerUid, damage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,9 +85,9 @@ namespace Content.Shared.Damage
|
||||
component.TotalDamage = component.Damage.Total;
|
||||
component.Dirty();
|
||||
|
||||
if (EntityManager.TryGetComponent<SharedAppearanceComponent>(component.Owner.Uid, out var appearance) && damageDelta != null)
|
||||
if (EntityManager.TryGetComponent<SharedAppearanceComponent>(component.OwnerUid, out var appearance) && damageDelta != null)
|
||||
appearance.SetData(DamageVisualizerKeys.DamageUpdateGroups, damageDelta.GetDamagePerGroup().Keys.ToList());
|
||||
RaiseLocalEvent(component.Owner.Uid, new DamageChangedEvent(component, damageDelta), false);
|
||||
RaiseLocalEvent(component.OwnerUid, new DamageChangedEvent(component, damageDelta), false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Content.Shared.Disposal
|
||||
|
||||
private void HandlePreventCollide(EntityUid uid, SharedDisposalUnitComponent component, PreventCollideEvent args)
|
||||
{
|
||||
var otherBody = args.BodyB.Owner.Uid;
|
||||
var otherBody = args.BodyB.OwnerUid;
|
||||
|
||||
// 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.Owner.Uid)) continue;
|
||||
Mover.UseMobMovement(body.OwnerUid)) continue;
|
||||
|
||||
var surfaceFriction = GetTileFriction(body);
|
||||
var bodyModifier = body.Owner.GetComponentOrNull<SharedTileFrictionModifier>()?.Modifier ?? 1.0f;
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Content.Shared.Hands
|
||||
if (entity.TryGetContainerMan(out var containerManager))
|
||||
{
|
||||
var parentMsg = new ContainedEntityDropHandItemsAttemptEvent(uid);
|
||||
eventBus.RaiseLocalEvent(containerManager.Owner.Uid, parentMsg);
|
||||
eventBus.RaiseLocalEvent(containerManager.OwnerUid, parentMsg);
|
||||
|
||||
if (parentMsg.Cancelled)
|
||||
return;
|
||||
|
||||
@@ -290,7 +290,7 @@ namespace Content.Shared.MobState.Components
|
||||
{
|
||||
if (!current.HasValue)
|
||||
{
|
||||
old?.ExitState(Owner.Uid, Owner.EntityManager);
|
||||
old?.ExitState(OwnerUid, Owner.EntityManager);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -300,16 +300,16 @@ namespace Content.Shared.MobState.Components
|
||||
|
||||
if (state == old)
|
||||
{
|
||||
state.UpdateState(Owner.Uid, threshold, Owner.EntityManager);
|
||||
state.UpdateState(OwnerUid, threshold, Owner.EntityManager);
|
||||
return;
|
||||
}
|
||||
|
||||
old?.ExitState(Owner.Uid, Owner.EntityManager);
|
||||
old?.ExitState(OwnerUid, Owner.EntityManager);
|
||||
|
||||
CurrentState = state;
|
||||
|
||||
state.EnterState(Owner.Uid, Owner.EntityManager);
|
||||
state.UpdateState(Owner.Uid, threshold, Owner.EntityManager);
|
||||
state.EnterState(OwnerUid, Owner.EntityManager);
|
||||
state.UpdateState(OwnerUid, threshold, Owner.EntityManager);
|
||||
|
||||
var message = new MobStateChangedMessage(this, old, state);
|
||||
#pragma warning disable 618
|
||||
|
||||
@@ -95,15 +95,15 @@ namespace Content.Shared.Movement
|
||||
protected void HandleMobMovement(IMoverComponent mover, PhysicsComponent physicsComponent,
|
||||
IMobMoverComponent mobMover)
|
||||
{
|
||||
DebugTools.Assert(!UsedMobMovement.ContainsKey(mover.Owner.Uid));
|
||||
DebugTools.Assert(!UsedMobMovement.ContainsKey(mover.OwnerUid));
|
||||
|
||||
if (!UseMobMovement(physicsComponent))
|
||||
{
|
||||
UsedMobMovement[mover.Owner.Uid] = false;
|
||||
UsedMobMovement[mover.OwnerUid] = false;
|
||||
return;
|
||||
}
|
||||
|
||||
UsedMobMovement[mover.Owner.Uid] = true;
|
||||
UsedMobMovement[mover.OwnerUid] = true;
|
||||
var transform = mover.Owner.Transform;
|
||||
var weightless = mover.Owner.IsWeightless(physicsComponent, mapManager: _mapManager, entityManager: _entityManager);
|
||||
var (walkDir, sprintDir) = mover.VelocityDir;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Content.Shared.Projectiles
|
||||
|
||||
private void PreventCollision(EntityUid uid, SharedProjectileComponent component, PreventCollideEvent args)
|
||||
{
|
||||
if (component.IgnoreShooter && args.BodyB.Owner.Uid == component.Shooter)
|
||||
if (component.IgnoreShooter && args.BodyB.OwnerUid == component.Shooter)
|
||||
{
|
||||
args.Cancel();
|
||||
return;
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Content.Shared.Pulling.Systems
|
||||
SharedPullerComponent component,
|
||||
PullStartedMessage args)
|
||||
{
|
||||
if (args.Puller.Owner.Uid != uid)
|
||||
if (args.Puller.OwnerUid != uid)
|
||||
return;
|
||||
|
||||
if (component.Owner.TryGetComponent(out SharedAlertsComponent? alerts))
|
||||
@@ -59,7 +59,7 @@ namespace Content.Shared.Pulling.Systems
|
||||
SharedPullerComponent component,
|
||||
PullStoppedMessage args)
|
||||
{
|
||||
if (args.Puller.Owner.Uid != uid)
|
||||
if (args.Puller.OwnerUid != uid)
|
||||
return;
|
||||
|
||||
if (component.Owner.TryGetComponent(out SharedAlertsComponent? alerts))
|
||||
|
||||
@@ -59,10 +59,10 @@ namespace Content.Shared.Pulling
|
||||
// Messaging
|
||||
var message = new PullStoppedMessage(pullerPhysics, pullablePhysics);
|
||||
|
||||
RaiseLocalEvent(puller.Owner.Uid, message, broadcast: false);
|
||||
RaiseLocalEvent(puller.OwnerUid, message, broadcast: false);
|
||||
|
||||
if (pullable.Owner.LifeStage <= EntityLifeStage.MapInitialized)
|
||||
RaiseLocalEvent(pullable.Owner.Uid, message);
|
||||
RaiseLocalEvent(pullable.OwnerUid, 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.Owner.Uid, pullerPhysics.Owner.Uid, id:$"pull-joint-{pullablePhysics.Owner.Uid}");
|
||||
pullable.PullJoint = _jointSystem.CreateDistanceJoint(pullablePhysics.OwnerUid, pullerPhysics.Owner.Uid, id:$"pull-joint-{pullablePhysics.Owner.Uid}");
|
||||
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.Owner.Uid, message, broadcast: false);
|
||||
RaiseLocalEvent(pullable.Owner.Uid, message);
|
||||
RaiseLocalEvent(puller.OwnerUid, message, broadcast: false);
|
||||
RaiseLocalEvent(pullable.OwnerUid, message);
|
||||
|
||||
// Networking
|
||||
puller.Dirty();
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace Content.Shared.Pulling
|
||||
}
|
||||
|
||||
var msg = new StopPullingEvent(user?.Uid);
|
||||
RaiseLocalEvent(pullable.Owner.Uid, msg);
|
||||
RaiseLocalEvent(pullable.OwnerUid, msg);
|
||||
|
||||
if (msg.Cancelled) return false;
|
||||
|
||||
@@ -154,14 +154,14 @@ namespace Content.Shared.Pulling
|
||||
|
||||
var pullAttempt = new PullAttemptMessage(pullerPhysics, pullablePhysics);
|
||||
|
||||
RaiseLocalEvent(puller.Owner.Uid, pullAttempt, broadcast: false);
|
||||
RaiseLocalEvent(puller.OwnerUid, pullAttempt, broadcast: false);
|
||||
|
||||
if (pullAttempt.Cancelled)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
RaiseLocalEvent(pullable.Owner.Uid, pullAttempt);
|
||||
RaiseLocalEvent(pullable.OwnerUid, 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.Owner.Uid != uid)
|
||||
if (args.Pulled.OwnerUid != uid)
|
||||
return;
|
||||
|
||||
if (component.Owner.TryGetComponent(out SharedAlertsComponent? alerts))
|
||||
@@ -111,7 +111,7 @@ namespace Content.Shared.Pulling
|
||||
|
||||
private static void PullableHandlePullStopped(EntityUid uid, SharedPullableComponent component, PullStoppedMessage args)
|
||||
{
|
||||
if (args.Pulled.Owner.Uid != uid)
|
||||
if (args.Pulled.OwnerUid != uid)
|
||||
return;
|
||||
|
||||
if (component.Owner.TryGetComponent(out SharedAlertsComponent? alerts))
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Content.Shared.Shuttles
|
||||
|
||||
public override ComponentState GetComponentState(ICommonSession player)
|
||||
{
|
||||
return new PilotComponentState(Console?.Owner.Uid);
|
||||
return new PilotComponentState(Console?.OwnerUid);
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Content.Shared.Slippery
|
||||
|
||||
private void HandleCollide(EntityUid uid, SlipperyComponent component, StartCollideEvent args)
|
||||
{
|
||||
var otherUid = args.OtherFixture.Body.Owner.Uid;
|
||||
var otherUid = args.OtherFixture.Body.OwnerUid;
|
||||
|
||||
if (!CanSlip(component, otherUid)) return;
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Content.Shared.Slippery
|
||||
|
||||
private bool TrySlip(SlipperyComponent component, IPhysBody ourBody, IPhysBody otherBody)
|
||||
{
|
||||
if (!CanSlip(component, otherBody.Owner.Uid)) return false;
|
||||
if (!CanSlip(component, otherBody.OwnerUid)) return false;
|
||||
|
||||
if (otherBody.LinearVelocity.Length < component.RequiredSlipSpeed)
|
||||
{
|
||||
@@ -86,14 +86,14 @@ namespace Content.Shared.Slippery
|
||||
}
|
||||
|
||||
var ev = new SlipAttemptEvent();
|
||||
RaiseLocalEvent(otherBody.Owner.Uid, ev, false);
|
||||
RaiseLocalEvent(otherBody.OwnerUid, ev, false);
|
||||
if (ev.Cancelled)
|
||||
return false;
|
||||
|
||||
otherBody.LinearVelocity *= component.LaunchForwardsMultiplier;
|
||||
|
||||
_stunSystem.TryParalyze(otherBody.Owner.Uid, TimeSpan.FromSeconds(5));
|
||||
component.Slipped.Add(otherBody.Owner.Uid);
|
||||
_stunSystem.TryParalyze(otherBody.OwnerUid, TimeSpan.FromSeconds(5));
|
||||
component.Slipped.Add(otherBody.OwnerUid);
|
||||
component.Dirty();
|
||||
|
||||
PlaySound(component);
|
||||
|
||||
Reference in New Issue
Block a user