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))
|
if (Owner.TryGetComponent<ConstructionComponent>(out var construction))
|
||||||
{
|
{
|
||||||
// Attempt to set pathfinding to the machine node...
|
// 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))
|
if (Owner.TryGetComponent(out ConstructionComponent? construction))
|
||||||
{
|
{
|
||||||
// So prying the components off works correctly.
|
// So prying the components off works correctly.
|
||||||
EntitySystem.Get<ConstructionSystem>().ResetEdge(Owner.Uid, construction);
|
EntitySystem.Get<ConstructionSystem>().ResetEdge(OwnerUid, construction);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ namespace Content.Shared.Actions.Components
|
|||||||
if (_holderActionsComponent == null) return;
|
if (_holderActionsComponent == null) return;
|
||||||
foreach (var (actionType, state) in _actions)
|
foreach (var (actionType, state) in _actions)
|
||||||
{
|
{
|
||||||
_holderActionsComponent.GrantOrUpdateItemAction(actionType, Owner.Uid, state);
|
_holderActionsComponent.GrantOrUpdateItemAction(actionType, OwnerUid, state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ namespace Content.Shared.Actions.Components
|
|||||||
if (_holderActionsComponent == null) return;
|
if (_holderActionsComponent == null) return;
|
||||||
foreach (var (actionType, state) in _actions)
|
foreach (var (actionType, state) in _actions)
|
||||||
{
|
{
|
||||||
_holderActionsComponent.RevokeItemAction(actionType, Owner.Uid);
|
_holderActionsComponent.RevokeItemAction(actionType, OwnerUid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ namespace Content.Shared.Actions.Components
|
|||||||
if (!dirty) return;
|
if (!dirty) return;
|
||||||
|
|
||||||
_actions[actionType] = actionState;
|
_actions[actionType] = actionState;
|
||||||
_holderActionsComponent?.GrantOrUpdateItemAction(actionType, Owner.Uid, actionState);
|
_holderActionsComponent?.GrantOrUpdateItemAction(actionType, OwnerUid, actionState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ namespace Content.Shared.Body.Components
|
|||||||
|
|
||||||
var argsAdded = new BodyPartAddedEventArgs(slot.Id, part);
|
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())
|
foreach (var component in Owner.GetAllComponents<IBodyPartAdded>().ToArray())
|
||||||
{
|
{
|
||||||
component.BodyPartAdded(argsAdded);
|
component.BodyPartAdded(argsAdded);
|
||||||
@@ -180,7 +180,7 @@ namespace Content.Shared.Body.Components
|
|||||||
var args = new BodyPartRemovedEventArgs(slot.Id, part);
|
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>())
|
foreach (var component in Owner.GetAllComponents<IBodyPartRemoved>())
|
||||||
{
|
{
|
||||||
component.BodyPartRemoved(args);
|
component.BodyPartRemoved(args);
|
||||||
@@ -190,14 +190,14 @@ namespace Content.Shared.Body.Components
|
|||||||
if (part.PartType == BodyPartType.Leg &&
|
if (part.PartType == BodyPartType.Leg &&
|
||||||
GetPartsOfType(BodyPartType.Leg).ToArray().Length == 0)
|
GetPartsOfType(BodyPartType.Leg).ToArray().Length == 0)
|
||||||
{
|
{
|
||||||
EntitySystem.Get<StandingStateSystem>().Down(Owner.Uid);
|
EntitySystem.Get<StandingStateSystem>().Down(OwnerUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (part.IsVital && SlotParts.Count(x => x.Value.PartType == part.PartType) == 0)
|
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.
|
// 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);
|
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();
|
OnBodyChanged();
|
||||||
@@ -556,7 +556,7 @@ namespace Content.Shared.Body.Components
|
|||||||
var i = 0;
|
var i = 0;
|
||||||
foreach (var (part, slot) in SlotParts)
|
foreach (var (part, slot) in SlotParts)
|
||||||
{
|
{
|
||||||
parts[i] = (slot.Id, part.Owner.Uid);
|
parts[i] = (slot.Id, part.OwnerUid);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ namespace Content.Shared.Body.Part
|
|||||||
var i = 0;
|
var i = 0;
|
||||||
foreach (var mechanism in _mechanisms)
|
foreach (var mechanism in _mechanisms)
|
||||||
{
|
{
|
||||||
mechanismIds[i] = mechanism.Owner.Uid;
|
mechanismIds[i] = mechanism.OwnerUid;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace Content.Shared.Buckle
|
|||||||
|
|
||||||
private void PreventCollision(EntityUid uid, SharedBuckleComponent component, PreventCollideEvent args)
|
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;
|
component.IsOnStrapEntityThisFrame = true;
|
||||||
if (component.Buckled || component.DontCollide)
|
if (component.Buckled || component.DontCollide)
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ namespace Content.Shared.Containers.ItemSlots
|
|||||||
{
|
{
|
||||||
// insert item
|
// insert item
|
||||||
slot.ContainerSlot.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
|
// play sound
|
||||||
if (slot.InsertSound != null)
|
if (slot.InsertSound != null)
|
||||||
@@ -248,7 +248,7 @@ namespace Content.Shared.Containers.ItemSlots
|
|||||||
if (slot.EjectSound != null)
|
if (slot.EjectSound != null)
|
||||||
SoundSystem.Play(Filter.Pvs(itemSlots.Owner), slot.EjectSound.GetSound(), itemSlots.Owner);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ namespace Content.Shared.Damage
|
|||||||
damage.DamageDict.Add(typeID, damageValue);
|
damage.DamageDict.Add(typeID, damageValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
EntitySystem.Get<DamageableSystem>().TryChangeDamage(Owner.Uid, damage);
|
EntitySystem.Get<DamageableSystem>().TryChangeDamage(OwnerUid, damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO EXPLOSION Remove this.
|
// TODO EXPLOSION Remove this.
|
||||||
@@ -113,7 +113,7 @@ namespace Content.Shared.Damage
|
|||||||
damage.DamageDict.Add(typeID, damageValue);
|
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.TotalDamage = component.Damage.Total;
|
||||||
component.Dirty();
|
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());
|
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>
|
/// <summary>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Content.Shared.Disposal
|
|||||||
|
|
||||||
private void HandlePreventCollide(EntityUid uid, SharedDisposalUnitComponent component, PreventCollideEvent args)
|
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
|
// Items dropped shouldn't collide but items thrown should
|
||||||
if (EntityManager.HasComponent<SharedItemComponent>(otherBody) &&
|
if (EntityManager.HasComponent<SharedItemComponent>(otherBody) &&
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ namespace Content.Shared.Friction
|
|||||||
if (body.Deleted ||
|
if (body.Deleted ||
|
||||||
prediction && !body.Predict ||
|
prediction && !body.Predict ||
|
||||||
body.BodyStatus == BodyStatus.InAir ||
|
body.BodyStatus == BodyStatus.InAir ||
|
||||||
Mover.UseMobMovement(body.Owner.Uid)) continue;
|
Mover.UseMobMovement(body.OwnerUid)) continue;
|
||||||
|
|
||||||
var surfaceFriction = GetTileFriction(body);
|
var surfaceFriction = GetTileFriction(body);
|
||||||
var bodyModifier = body.Owner.GetComponentOrNull<SharedTileFrictionModifier>()?.Modifier ?? 1.0f;
|
var bodyModifier = body.Owner.GetComponentOrNull<SharedTileFrictionModifier>()?.Modifier ?? 1.0f;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace Content.Shared.Hands
|
|||||||
if (entity.TryGetContainerMan(out var containerManager))
|
if (entity.TryGetContainerMan(out var containerManager))
|
||||||
{
|
{
|
||||||
var parentMsg = new ContainedEntityDropHandItemsAttemptEvent(uid);
|
var parentMsg = new ContainedEntityDropHandItemsAttemptEvent(uid);
|
||||||
eventBus.RaiseLocalEvent(containerManager.Owner.Uid, parentMsg);
|
eventBus.RaiseLocalEvent(containerManager.OwnerUid, parentMsg);
|
||||||
|
|
||||||
if (parentMsg.Cancelled)
|
if (parentMsg.Cancelled)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ namespace Content.Shared.MobState.Components
|
|||||||
{
|
{
|
||||||
if (!current.HasValue)
|
if (!current.HasValue)
|
||||||
{
|
{
|
||||||
old?.ExitState(Owner.Uid, Owner.EntityManager);
|
old?.ExitState(OwnerUid, Owner.EntityManager);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -300,16 +300,16 @@ namespace Content.Shared.MobState.Components
|
|||||||
|
|
||||||
if (state == old)
|
if (state == old)
|
||||||
{
|
{
|
||||||
state.UpdateState(Owner.Uid, threshold, Owner.EntityManager);
|
state.UpdateState(OwnerUid, threshold, Owner.EntityManager);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
old?.ExitState(Owner.Uid, Owner.EntityManager);
|
old?.ExitState(OwnerUid, Owner.EntityManager);
|
||||||
|
|
||||||
CurrentState = state;
|
CurrentState = state;
|
||||||
|
|
||||||
state.EnterState(Owner.Uid, Owner.EntityManager);
|
state.EnterState(OwnerUid, Owner.EntityManager);
|
||||||
state.UpdateState(Owner.Uid, threshold, Owner.EntityManager);
|
state.UpdateState(OwnerUid, threshold, Owner.EntityManager);
|
||||||
|
|
||||||
var message = new MobStateChangedMessage(this, old, state);
|
var message = new MobStateChangedMessage(this, old, state);
|
||||||
#pragma warning disable 618
|
#pragma warning disable 618
|
||||||
|
|||||||
@@ -95,15 +95,15 @@ namespace Content.Shared.Movement
|
|||||||
protected void HandleMobMovement(IMoverComponent mover, PhysicsComponent physicsComponent,
|
protected void HandleMobMovement(IMoverComponent mover, PhysicsComponent physicsComponent,
|
||||||
IMobMoverComponent mobMover)
|
IMobMoverComponent mobMover)
|
||||||
{
|
{
|
||||||
DebugTools.Assert(!UsedMobMovement.ContainsKey(mover.Owner.Uid));
|
DebugTools.Assert(!UsedMobMovement.ContainsKey(mover.OwnerUid));
|
||||||
|
|
||||||
if (!UseMobMovement(physicsComponent))
|
if (!UseMobMovement(physicsComponent))
|
||||||
{
|
{
|
||||||
UsedMobMovement[mover.Owner.Uid] = false;
|
UsedMobMovement[mover.OwnerUid] = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UsedMobMovement[mover.Owner.Uid] = true;
|
UsedMobMovement[mover.OwnerUid] = true;
|
||||||
var transform = mover.Owner.Transform;
|
var transform = mover.Owner.Transform;
|
||||||
var weightless = mover.Owner.IsWeightless(physicsComponent, mapManager: _mapManager, entityManager: _entityManager);
|
var weightless = mover.Owner.IsWeightless(physicsComponent, mapManager: _mapManager, entityManager: _entityManager);
|
||||||
var (walkDir, sprintDir) = mover.VelocityDir;
|
var (walkDir, sprintDir) = mover.VelocityDir;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Content.Shared.Projectiles
|
|||||||
|
|
||||||
private void PreventCollision(EntityUid uid, SharedProjectileComponent component, PreventCollideEvent args)
|
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();
|
args.Cancel();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace Content.Shared.Pulling.Systems
|
|||||||
SharedPullerComponent component,
|
SharedPullerComponent component,
|
||||||
PullStartedMessage args)
|
PullStartedMessage args)
|
||||||
{
|
{
|
||||||
if (args.Puller.Owner.Uid != uid)
|
if (args.Puller.OwnerUid != uid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (component.Owner.TryGetComponent(out SharedAlertsComponent? alerts))
|
if (component.Owner.TryGetComponent(out SharedAlertsComponent? alerts))
|
||||||
@@ -59,7 +59,7 @@ namespace Content.Shared.Pulling.Systems
|
|||||||
SharedPullerComponent component,
|
SharedPullerComponent component,
|
||||||
PullStoppedMessage args)
|
PullStoppedMessage args)
|
||||||
{
|
{
|
||||||
if (args.Puller.Owner.Uid != uid)
|
if (args.Puller.OwnerUid != uid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (component.Owner.TryGetComponent(out SharedAlertsComponent? alerts))
|
if (component.Owner.TryGetComponent(out SharedAlertsComponent? alerts))
|
||||||
|
|||||||
@@ -59,10 +59,10 @@ namespace Content.Shared.Pulling
|
|||||||
// Messaging
|
// Messaging
|
||||||
var message = new PullStoppedMessage(pullerPhysics, pullablePhysics);
|
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)
|
if (pullable.Owner.LifeStage <= EntityLifeStage.MapInitialized)
|
||||||
RaiseLocalEvent(pullable.Owner.Uid, message);
|
RaiseLocalEvent(pullable.OwnerUid, message);
|
||||||
|
|
||||||
// Networking
|
// Networking
|
||||||
puller.Dirty();
|
puller.Dirty();
|
||||||
@@ -106,7 +106,7 @@ namespace Content.Shared.Pulling
|
|||||||
var union = pullerPhysics.GetWorldAABB().Union(pullablePhysics.GetWorldAABB());
|
var union = pullerPhysics.GetWorldAABB().Union(pullablePhysics.GetWorldAABB());
|
||||||
var length = Math.Max(union.Size.X, union.Size.Y) * 0.75f;
|
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;
|
pullable.PullJoint.CollideConnected = false;
|
||||||
// This maximum has to be there because if the object is constrained too closely, the clamping goes backwards and asserts.
|
// 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);
|
pullable.PullJoint.MaxLength = Math.Max(1.0f, length);
|
||||||
@@ -117,8 +117,8 @@ namespace Content.Shared.Pulling
|
|||||||
// Messaging
|
// Messaging
|
||||||
var message = new PullStartedMessage(pullerPhysics, pullablePhysics);
|
var message = new PullStartedMessage(pullerPhysics, pullablePhysics);
|
||||||
|
|
||||||
RaiseLocalEvent(puller.Owner.Uid, message, broadcast: false);
|
RaiseLocalEvent(puller.OwnerUid, message, broadcast: false);
|
||||||
RaiseLocalEvent(pullable.Owner.Uid, message);
|
RaiseLocalEvent(pullable.OwnerUid, message);
|
||||||
|
|
||||||
// Networking
|
// Networking
|
||||||
puller.Dirty();
|
puller.Dirty();
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ namespace Content.Shared.Pulling
|
|||||||
}
|
}
|
||||||
|
|
||||||
var msg = new StopPullingEvent(user?.Uid);
|
var msg = new StopPullingEvent(user?.Uid);
|
||||||
RaiseLocalEvent(pullable.Owner.Uid, msg);
|
RaiseLocalEvent(pullable.OwnerUid, msg);
|
||||||
|
|
||||||
if (msg.Cancelled) return false;
|
if (msg.Cancelled) return false;
|
||||||
|
|
||||||
@@ -154,14 +154,14 @@ namespace Content.Shared.Pulling
|
|||||||
|
|
||||||
var pullAttempt = new PullAttemptMessage(pullerPhysics, pullablePhysics);
|
var pullAttempt = new PullAttemptMessage(pullerPhysics, pullablePhysics);
|
||||||
|
|
||||||
RaiseLocalEvent(puller.Owner.Uid, pullAttempt, broadcast: false);
|
RaiseLocalEvent(puller.OwnerUid, pullAttempt, broadcast: false);
|
||||||
|
|
||||||
if (pullAttempt.Cancelled)
|
if (pullAttempt.Cancelled)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
RaiseLocalEvent(pullable.Owner.Uid, pullAttempt);
|
RaiseLocalEvent(pullable.OwnerUid, pullAttempt);
|
||||||
|
|
||||||
if (pullAttempt.Cancelled)
|
if (pullAttempt.Cancelled)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ namespace Content.Shared.Pulling
|
|||||||
// Raise a "you are being pulled" alert if the pulled entity has alerts.
|
// Raise a "you are being pulled" alert if the pulled entity has alerts.
|
||||||
private static void PullableHandlePullStarted(EntityUid uid, SharedPullableComponent component, PullStartedMessage args)
|
private static void PullableHandlePullStarted(EntityUid uid, SharedPullableComponent component, PullStartedMessage args)
|
||||||
{
|
{
|
||||||
if (args.Pulled.Owner.Uid != uid)
|
if (args.Pulled.OwnerUid != uid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (component.Owner.TryGetComponent(out SharedAlertsComponent? alerts))
|
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)
|
private static void PullableHandlePullStopped(EntityUid uid, SharedPullableComponent component, PullStoppedMessage args)
|
||||||
{
|
{
|
||||||
if (args.Pulled.Owner.Uid != uid)
|
if (args.Pulled.OwnerUid != uid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (component.Owner.TryGetComponent(out SharedAlertsComponent? alerts))
|
if (component.Owner.TryGetComponent(out SharedAlertsComponent? alerts))
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace Content.Shared.Shuttles
|
|||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState(ICommonSession player)
|
||||||
{
|
{
|
||||||
return new PilotComponentState(Console?.Owner.Uid);
|
return new PilotComponentState(Console?.OwnerUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace Content.Shared.Slippery
|
|||||||
|
|
||||||
private void HandleCollide(EntityUid uid, SlipperyComponent component, StartCollideEvent args)
|
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;
|
if (!CanSlip(component, otherUid)) return;
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ namespace Content.Shared.Slippery
|
|||||||
|
|
||||||
private bool TrySlip(SlipperyComponent component, IPhysBody ourBody, IPhysBody otherBody)
|
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)
|
if (otherBody.LinearVelocity.Length < component.RequiredSlipSpeed)
|
||||||
{
|
{
|
||||||
@@ -86,14 +86,14 @@ namespace Content.Shared.Slippery
|
|||||||
}
|
}
|
||||||
|
|
||||||
var ev = new SlipAttemptEvent();
|
var ev = new SlipAttemptEvent();
|
||||||
RaiseLocalEvent(otherBody.Owner.Uid, ev, false);
|
RaiseLocalEvent(otherBody.OwnerUid, ev, false);
|
||||||
if (ev.Cancelled)
|
if (ev.Cancelled)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
otherBody.LinearVelocity *= component.LaunchForwardsMultiplier;
|
otherBody.LinearVelocity *= component.LaunchForwardsMultiplier;
|
||||||
|
|
||||||
_stunSystem.TryParalyze(otherBody.Owner.Uid, TimeSpan.FromSeconds(5));
|
_stunSystem.TryParalyze(otherBody.OwnerUid, TimeSpan.FromSeconds(5));
|
||||||
component.Slipped.Add(otherBody.Owner.Uid);
|
component.Slipped.Add(otherBody.OwnerUid);
|
||||||
component.Dirty();
|
component.Dirty();
|
||||||
|
|
||||||
PlaySound(component);
|
PlaySound(component);
|
||||||
|
|||||||
Reference in New Issue
Block a user