More Changes
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using Content.Shared.Conveyor;
|
using Content.Shared.Conveyor;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
@@ -23,7 +23,7 @@ namespace Content.Client.Conveyor.Visualizers
|
|||||||
private void ChangeState(AppearanceComponent appearance)
|
private void ChangeState(AppearanceComponent appearance)
|
||||||
{
|
{
|
||||||
var entities = IoCManager.Resolve<IEntityManager>();
|
var entities = IoCManager.Resolve<IEntityManager>();
|
||||||
if (!entities.TryGetComponent(appearance.Owner, out ISpriteComponent? sprite))
|
if (!entities.TryGetComponent(appearance.OwnerUid, out ISpriteComponent? sprite))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -45,8 +45,8 @@ namespace Content.Client.Conveyor.Visualizers
|
|||||||
public override void InitializeEntity(EntityUid entity)
|
public override void InitializeEntity(EntityUid entity)
|
||||||
{
|
{
|
||||||
base.InitializeEntity(entity);
|
base.InitializeEntity(entity);
|
||||||
|
var entities = IoCManager.Resolve<IEntityManager>();
|
||||||
var appearance = entity.EnsureComponent<ClientAppearanceComponent>();
|
var appearance = entities.EnsureComponent<ClientAppearanceComponent>(entity);
|
||||||
ChangeState(appearance);
|
ChangeState(appearance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Content.Client.Conveyor.Visualizers
|
|||||||
private void ChangeState(AppearanceComponent appearance)
|
private void ChangeState(AppearanceComponent appearance)
|
||||||
{
|
{
|
||||||
var entities = IoCManager.Resolve<IEntityManager>();
|
var entities = IoCManager.Resolve<IEntityManager>();
|
||||||
if (!entities.TryGetComponent(appearance.Owner, out ISpriteComponent? sprite))
|
if (!entities.TryGetComponent(appearance.OwnerUid, out ISpriteComponent? sprite))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,8 @@ namespace Content.Client.Conveyor.Visualizers
|
|||||||
{
|
{
|
||||||
base.InitializeEntity(entity);
|
base.InitializeEntity(entity);
|
||||||
|
|
||||||
var appearance = entity.EnsureComponent<ClientAppearanceComponent>();
|
var entities = IoCManager.Resolve<IEntityManager>();
|
||||||
|
var appearance = entities.EnsureComponent<ClientAppearanceComponent>(entity);
|
||||||
ChangeState(appearance);
|
ChangeState(appearance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ namespace Content.Client.Disposal.Visualizers
|
|||||||
}
|
}
|
||||||
|
|
||||||
var entities = IoCManager.Resolve<IEntityManager>();
|
var entities = IoCManager.Resolve<IEntityManager>();
|
||||||
if (!entities.TryGetComponent(appearance.Owner, out ISpriteComponent? sprite))
|
if (!entities.TryGetComponent(appearance.OwnerUid, out ISpriteComponent? sprite))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ namespace Content.Client.Disposal.Visualizers
|
|||||||
case VisualState.Flushing:
|
case VisualState.Flushing:
|
||||||
sprite.LayerSetState(DisposalUnitVisualLayers.Base, _stateAnchored);
|
sprite.LayerSetState(DisposalUnitVisualLayers.Base, _stateAnchored);
|
||||||
|
|
||||||
var animPlayer = IoCManager.Resolve<IEntityManager>().GetComponent<AnimationPlayerComponent>(appearance.Owner);
|
var animPlayer = IoCManager.Resolve<IEntityManager>().GetComponent<AnimationPlayerComponent>(appearance.OwnerUid);
|
||||||
|
|
||||||
if (!animPlayer.HasRunningAnimation(AnimationKey))
|
if (!animPlayer.HasRunningAnimation(AnimationKey))
|
||||||
{
|
{
|
||||||
@@ -148,9 +148,9 @@ namespace Content.Client.Disposal.Visualizers
|
|||||||
public override void InitializeEntity(EntityUid entity)
|
public override void InitializeEntity(EntityUid entity)
|
||||||
{
|
{
|
||||||
base.InitializeEntity(entity);
|
base.InitializeEntity(entity);
|
||||||
|
var entities = IoCManager.Resolve<IEntityManager>();
|
||||||
entity.EnsureComponent<AnimationPlayerComponent>();
|
entities.EnsureComponent<AnimationPlayerComponent>(entity);
|
||||||
var appearance = entity.EnsureComponent<ClientAppearanceComponent>();
|
var appearance = entities.EnsureComponent<ClientAppearanceComponent>(entity);
|
||||||
|
|
||||||
ChangeState(appearance);
|
ChangeState(appearance);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Content.Client.Disposal.Visualizers
|
|||||||
private void ChangeState(AppearanceComponent appearance)
|
private void ChangeState(AppearanceComponent appearance)
|
||||||
{
|
{
|
||||||
var entities = IoCManager.Resolve<IEntityManager>();
|
var entities = IoCManager.Resolve<IEntityManager>();
|
||||||
if (!entities.TryGetComponent(appearance.Owner, out ISpriteComponent? sprite))
|
if (!entities.TryGetComponent(appearance.OwnerUid, out ISpriteComponent? sprite))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -48,17 +48,17 @@ namespace Content.Client.Disposal.Visualizers
|
|||||||
{
|
{
|
||||||
appearance.Owner.EnsureComponent<SubFloorHideComponent>();
|
appearance.Owner.EnsureComponent<SubFloorHideComponent>();
|
||||||
}
|
}
|
||||||
else if (IoCManager.Resolve<IEntityManager>().HasComponent<SubFloorHideComponent>(appearance.Owner))
|
else if (IoCManager.Resolve<IEntityManager>().HasComponent<SubFloorHideComponent>(appearance.OwnerUid))
|
||||||
{
|
{
|
||||||
IoCManager.Resolve<IEntityManager>().RemoveComponent<SubFloorHideComponent>(appearance.Owner);
|
IoCManager.Resolve<IEntityManager>().RemoveComponent<SubFloorHideComponent>(appearance.OwnerUid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void InitializeEntity(EntityUid entity)
|
public override void InitializeEntity(EntityUid entity)
|
||||||
{
|
{
|
||||||
base.InitializeEntity(entity);
|
base.InitializeEntity(entity);
|
||||||
|
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||||
var appearance = entity.EnsureComponent<ClientAppearanceComponent>();
|
var appearance = entityManager.EnsureComponent<ClientAppearanceComponent>(entity);
|
||||||
ChangeState(appearance);
|
ChangeState(appearance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ namespace Content.Client.Singularity
|
|||||||
var distortions = _entityManager.EntityQuery<SingularityDistortionComponent>();
|
var distortions = _entityManager.EntityQuery<SingularityDistortionComponent>();
|
||||||
foreach (var distortion in distortions) //Add all singulos that are not added yet but qualify
|
foreach (var distortion in distortions) //Add all singulos that are not added yet but qualify
|
||||||
{
|
{
|
||||||
var singuloEntity = distortion.Owner;
|
var singuloEntity = distortion.OwnerUid;
|
||||||
|
|
||||||
if (!_singularities.Keys.Contains(singuloEntity) && SinguloQualifies(singuloEntity, currentEyeLoc))
|
if (!_singularities.Keys.Contains(singuloEntity) && SinguloQualifies(singuloEntity, currentEyeLoc))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ namespace Content.Client.StationEvents
|
|||||||
var pulses = _entityManager.EntityQuery<RadiationPulseComponent>();
|
var pulses = _entityManager.EntityQuery<RadiationPulseComponent>();
|
||||||
foreach (var pulse in pulses) //Add all pulses that are not added yet but qualify
|
foreach (var pulse in pulses) //Add all pulses that are not added yet but qualify
|
||||||
{
|
{
|
||||||
var pulseEntity = pulse.Owner;
|
var pulseEntity = pulse.OwnerUid;
|
||||||
|
|
||||||
if (!_pulses.Keys.Contains(pulseEntity) && PulseQualifies(pulseEntity, currentEyeLoc))
|
if (!_pulses.Keys.Contains(pulseEntity) && PulseQualifies(pulseEntity, currentEyeLoc))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ namespace Content.Server.Access.Systems
|
|||||||
{
|
{
|
||||||
if (inventoryComponent.HasSlot(EquipmentSlotDefines.Slots.IDCARD) &&
|
if (inventoryComponent.HasSlot(EquipmentSlotDefines.Slots.IDCARD) &&
|
||||||
inventoryComponent.TryGetSlotItem(EquipmentSlotDefines.Slots.IDCARD, out ItemComponent? item) &&
|
inventoryComponent.TryGetSlotItem(EquipmentSlotDefines.Slots.IDCARD, out ItemComponent? item) &&
|
||||||
FindAccessTagsItem(item.Owner, out tags)
|
FindAccessTagsItem(item.OwnerUid, out tags)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ namespace Content.Server.Advertise
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (_prototypeManager.TryIndex(advertise.PackPrototypeId, out AdvertisementsPackPrototype? advertisements))
|
if (_prototypeManager.TryIndex(advertise.PackPrototypeId, out AdvertisementsPackPrototype? advertisements))
|
||||||
_chatManager.EntitySay(advertise.Owner, Loc.GetString(_random.Pick(advertisements.Advertisements)), hideChat: true);
|
_chatManager.EntitySay(advertise.OwnerUid, Loc.GetString(_random.Pick(advertisements.Advertisements)), hideChat: true);
|
||||||
|
|
||||||
if(refresh)
|
if(refresh)
|
||||||
RefreshTimer(uid, true, advertise);
|
RefreshTimer(uid, true, advertise);
|
||||||
@@ -117,7 +117,7 @@ namespace Content.Server.Advertise
|
|||||||
if (advertise.NextAdvertisementTime > curTime)
|
if (advertise.NextAdvertisementTime > curTime)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SayAdvertisement(advertise.Owner, true, advertise);
|
SayAdvertisement(advertise.OwnerUid, true, advertise);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
{
|
{
|
||||||
if (airtight.FixAirBlockedDirectionInitialize)
|
if (airtight.FixAirBlockedDirectionInitialize)
|
||||||
{
|
{
|
||||||
var rotateEvent = new RotateEvent(airtight.Owner, Angle.Zero, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner).WorldRotation);
|
var rotateEvent = new RotateEvent(airtight.OwnerUid, Angle.Zero, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner).WorldRotation);
|
||||||
OnAirtightRotated(uid, airtight, ref rotateEvent);
|
OnAirtightRotated(uid, airtight, ref rotateEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
{
|
{
|
||||||
airtight.AirBlocked = airblocked;
|
airtight.AirBlocked = airblocked;
|
||||||
UpdatePosition(airtight);
|
UpdatePosition(airtight);
|
||||||
RaiseLocalEvent(((IComponent) airtight).Owner, new AirtightChanged(airtight));
|
RaiseLocalEvent(((IComponent) airtight).OwnerUid, new AirtightChanged(airtight));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdatePosition(AirtightComponent airtight)
|
public void UpdatePosition(AirtightComponent airtight)
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ namespace Content.Server.Climbing.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void TryClimb(EntityUiduser)
|
public async void TryClimb(EntityUid user)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(user, out ClimbingComponent? climbingComponent) || climbingComponent.IsClimbing)
|
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(user, out ClimbingComponent? climbingComponent) || climbingComponent.IsClimbing)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ namespace Content.Server.Clothing.Components
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryEquip(InventoryComponent inv, Slots slot, EntityUiduser)
|
public bool TryEquip(InventoryComponent inv, Slots slot, EntityUid user)
|
||||||
{
|
{
|
||||||
if (!inv.Equip(slot, this, true, out var reason))
|
if (!inv.Equip(slot, this, true, out var reason))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace Content.Server.Clothing.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Toggle(EntityUiduser)
|
public void Toggle(EntityUid user)
|
||||||
{
|
{
|
||||||
On = !On;
|
On = !On;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace Content.Server.Cuffs
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!EntityManager.EntityExists(args.User)
|
if (!EntityManager.EntityExists(args.User))
|
||||||
{
|
{
|
||||||
// Should this even be possible?
|
// Should this even be possible?
|
||||||
args.Cancel();
|
args.Cancel();
|
||||||
|
|||||||
@@ -19,10 +19,7 @@ namespace Content.Server.DeviceNetwork.Systems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void OnBeforePacketSent(EntityUid uid, WiredNetworkComponent component, BeforePacketSentEvent args)
|
private void OnBeforePacketSent(EntityUid uid, WiredNetworkComponent component, BeforePacketSentEvent args)
|
||||||
{
|
{
|
||||||
args.Sender
|
if (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(uid).GridID != IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.Sender).GridID)
|
||||||
uid
|
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(receiver).GridID != IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(sender).GridID)
|
|
||||||
{
|
{
|
||||||
args.Cancel();
|
args.Cancel();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ namespace Content.Server.Flash
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool UseFlash(FlashComponent comp, EntityUiduser)
|
private bool UseFlash(FlashComponent comp, EntityUid user)
|
||||||
{
|
{
|
||||||
if (comp.HasUses)
|
if (comp.HasUses)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Content.Server.Radio.Components;
|
using Content.Server.Radio.Components;
|
||||||
using Content.Shared.Chat;
|
using Content.Shared.Chat;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
@@ -23,7 +23,7 @@ namespace Content.Server.Ghost.Components
|
|||||||
|
|
||||||
public IReadOnlyList<int> Channels => _channels;
|
public IReadOnlyList<int> Channels => _channels;
|
||||||
|
|
||||||
public void Receive(string message, int channel, EntityUidspeaker)
|
public void Receive(string message, int channel, EntityUid speaker)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out ActorComponent? actor))
|
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out ActorComponent? actor))
|
||||||
return;
|
return;
|
||||||
@@ -39,6 +39,6 @@ namespace Content.Server.Ghost.Components
|
|||||||
_netManager.ServerSendMessage(msg, playerChannel);
|
_netManager.ServerSendMessage(msg, playerChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Broadcast(string message, EntityUidspeaker) { }
|
public void Broadcast(string message, EntityUid speaker) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ namespace Content.Server.Hands.Systems
|
|||||||
|
|
||||||
private void HandlePullStarted(EntityUid uid, HandsComponent component, PullStartedMessage args)
|
private void HandlePullStarted(EntityUid uid, HandsComponent component, PullStartedMessage args)
|
||||||
{
|
{
|
||||||
if (!_virtualItemSystem.TrySpawnVirtualItemInHand(args.Pulled.Owner, uid))
|
if (!_virtualItemSystem.TrySpawnVirtualItemInHand(args.Pulled.OwnerUid, uid))
|
||||||
{
|
{
|
||||||
DebugTools.Assert("Unable to find available hand when starting pulling??");
|
DebugTools.Assert("Unable to find available hand when starting pulling??");
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,7 @@ namespace Content.Server.Hands.Systems
|
|||||||
{
|
{
|
||||||
if (hand.HeldEntity == default
|
if (hand.HeldEntity == default
|
||||||
|| !EntityManager.TryGetComponent(hand.HeldEntity, out HandVirtualItemComponent? virtualItem)
|
|| !EntityManager.TryGetComponent(hand.HeldEntity, out HandVirtualItemComponent? virtualItem)
|
||||||
|| virtualItem.BlockingEntity != args.Pulled.Owner)
|
|| virtualItem.BlockingEntity != args.Pulled.OwnerUid)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
EntityManager.DeleteEntity(hand.HeldEntity);
|
EntityManager.DeleteEntity(hand.HeldEntity);
|
||||||
@@ -94,7 +94,7 @@ namespace Content.Server.Hands.Systems
|
|||||||
|
|
||||||
private void SwapHandsPressed(ICommonSession? session)
|
private void SwapHandsPressed(ICommonSession? session)
|
||||||
{
|
{
|
||||||
var player = session?.AttachedEntity;
|
var player = session?.AttachedEntityUid;
|
||||||
|
|
||||||
if (!player.HasValue || !player.Value.IsValid())
|
if (!player.HasValue || !player.Value.IsValid())
|
||||||
return;
|
return;
|
||||||
@@ -110,9 +110,9 @@ namespace Content.Server.Hands.Systems
|
|||||||
|
|
||||||
private bool DropPressed(ICommonSession? session, EntityCoordinates coords, EntityUid uid)
|
private bool DropPressed(ICommonSession? session, EntityCoordinates coords, EntityUid uid)
|
||||||
{
|
{
|
||||||
var player = session?.AttachedEntity;
|
var player = session?.AttachedEntityUid;
|
||||||
|
|
||||||
if (player == default)
|
if (!player.HasValue || !player.Value.IsValid())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!EntityManager.TryGetComponent(player.Value, out SharedHandsComponent? hands))
|
if (!EntityManager.TryGetComponent(player.Value, out SharedHandsComponent? hands))
|
||||||
@@ -171,7 +171,7 @@ namespace Content.Server.Hands.Systems
|
|||||||
{
|
{
|
||||||
foreach (var inhand in component.GetAllHeldItems())
|
foreach (var inhand in component.GetAllHeldItems())
|
||||||
{
|
{
|
||||||
if (EntityManager.HasComponent<HandVirtualItemComponent>(inhand.Owner))
|
if (EntityManager.HasComponent<HandVirtualItemComponent>(inhand.OwnerUid))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
args.PushText(Loc.GetString("comp-hands-examine", ("user", component.Owner), ("item", inhand.Owner)));
|
args.PushText(Loc.GetString("comp-hands-examine", ("user", component.Owner), ("item", inhand.Owner)));
|
||||||
@@ -187,12 +187,12 @@ namespace Content.Server.Hands.Systems
|
|||||||
if (session is not IPlayerSession playerSession)
|
if (session is not IPlayerSession playerSession)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var playerEnt = playerSession.AttachedEntity;
|
var player = playerSession.AttachedEntityUid;
|
||||||
|
|
||||||
if (playerEnt == default || !EntityManager.EntityExists(playerEnt))
|
if (!player.HasValue || !player.Value.IsValid())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return EntityManager.TryGetComponent(playerEnt, out hands);
|
return EntityManager.TryGetComponent(player.Value, out hands);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleActivateItem(ICommonSession? session)
|
private void HandleActivateItem(ICommonSession? session)
|
||||||
@@ -216,14 +216,15 @@ namespace Content.Server.Hands.Systems
|
|||||||
if (session is not IPlayerSession playerSession)
|
if (session is not IPlayerSession playerSession)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var playerEnt = playerSession.AttachedEntity;
|
var maybePlayer = playerSession.AttachedEntityUid;
|
||||||
|
if (!maybePlayer.HasValue) return false;
|
||||||
|
var player = maybePlayer.Value;
|
||||||
|
|
||||||
if (playerEnt == default ||
|
if (!EntityManager.EntityExists(player) ||
|
||||||
!EntityManager.EntityExists(playerEnt) ||
|
player.IsInContainer() ||
|
||||||
playerEnt.IsInContainer() ||
|
!EntityManager.TryGetComponent(player, out SharedHandsComponent? hands) ||
|
||||||
!EntityManager.TryGetComponent(playerEnt, out SharedHandsComponent? hands) ||
|
|
||||||
!hands.TryGetActiveHeldEntity(out var throwEnt) ||
|
!hands.TryGetActiveHeldEntity(out var throwEnt) ||
|
||||||
!_actionBlockerSystem.CanThrow(playerEnt))
|
!_actionBlockerSystem.CanThrow(player))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (EntityManager.TryGetComponent(throwEnt, out StackComponent? stack) && stack.Count > 1 && stack.ThrowIndividually)
|
if (EntityManager.TryGetComponent(throwEnt, out StackComponent? stack) && stack.Count > 1 && stack.ThrowIndividually)
|
||||||
@@ -275,7 +276,7 @@ namespace Content.Server.Hands.Systems
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!inventory.TryGetSlotItem(equipmentSlot, out ItemComponent? equipmentItem) ||
|
if (!inventory.TryGetSlotItem(equipmentSlot, out ItemComponent? equipmentItem) ||
|
||||||
!EntityManager.TryGetComponent(equipmentItem.Owner, out ServerStorageComponent? storageComponent))
|
!EntityManager.TryGetComponent(equipmentItem.OwnerUid, out ServerStorageComponent? storageComponent))
|
||||||
{
|
{
|
||||||
plyEnt.PopupMessage(Loc.GetString("hands-system-missing-equipment-slot", ("slotName", SlotNames[equipmentSlot].ToLower())));
|
plyEnt.PopupMessage(Loc.GetString("hands-system-missing-equipment-slot", ("slotName", SlotNames[equipmentSlot].ToLower())));
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -50,16 +50,16 @@ namespace Content.Server.Headset
|
|||||||
_radioSystem = EntitySystem.Get<RadioSystem>();
|
_radioSystem = EntitySystem.Get<RadioSystem>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanListen(string message, EntityUidsource)
|
public bool CanListen(string message, EntityUid source)
|
||||||
{
|
{
|
||||||
return RadioRequested;
|
return RadioRequested;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Receive(string message, int channel, EntityUidsource)
|
public void Receive(string message, int channel, EntityUid source)
|
||||||
{
|
{
|
||||||
if (Owner.TryGetContainer(out var container))
|
if (Owner.TryGetContainer(out var container))
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(container.Owner, out ActorComponent? actor))
|
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(container.OwnerUid, out ActorComponent? actor))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var playerChannel = actor.PlayerSession.ConnectedClient;
|
var playerChannel = actor.PlayerSession.ConnectedClient;
|
||||||
@@ -74,12 +74,12 @@ namespace Content.Server.Headset
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Listen(string message, EntityUidspeaker)
|
public void Listen(string message, EntityUid speaker)
|
||||||
{
|
{
|
||||||
Broadcast(message, speaker);
|
Broadcast(message, speaker);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Broadcast(string message, EntityUidspeaker)
|
public void Broadcast(string message, EntityUid speaker)
|
||||||
{
|
{
|
||||||
_radioSystem.SpreadMessage(this, speaker, message, BroadcastFrequency);
|
_radioSystem.SpreadMessage(this, speaker, message, BroadcastFrequency);
|
||||||
RadioRequested = false;
|
RadioRequested = false;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Content.Server.Jobs
|
|||||||
[DataField("component", required:true)]
|
[DataField("component", required:true)]
|
||||||
public string Component { get; } = string.Empty;
|
public string Component { get; } = string.Empty;
|
||||||
|
|
||||||
public override void AfterEquip(EntityUidmob)
|
public override void AfterEquip(EntityUid mob)
|
||||||
{
|
{
|
||||||
// Yes, this will throw if your component is invalid.
|
// Yes, this will throw if your component is invalid.
|
||||||
var component = (Component)IoCManager.Resolve<IComponentFactory>().GetComponent(Component);
|
var component = (Component)IoCManager.Resolve<IComponentFactory>().GetComponent(Component);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace Content.Server.Jobs
|
|||||||
[DataField("prototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
|
[DataField("prototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||||
public string Prototype { get; } = string.Empty;
|
public string Prototype { get; } = string.Empty;
|
||||||
|
|
||||||
public override void AfterEquip(EntityUidmob)
|
public override void AfterEquip(EntityUid mob)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Holiday) || string.IsNullOrEmpty(Prototype))
|
if (string.IsNullOrEmpty(Holiday) || string.IsNullOrEmpty(Prototype))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ namespace Content.Server.Kitchen.Components
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void TrySpike(EntityUid victim, EntityUiduser)
|
public async void TrySpike(EntityUid victim, EntityUid user)
|
||||||
{
|
{
|
||||||
var victimUid = (EntityUid) victim;
|
var victimUid = (EntityUid) victim;
|
||||||
if (_beingButchered.Contains(victimUid)) return;
|
if (_beingButchered.Contains(victimUid)) return;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ namespace Content.Server.Light.Components
|
|||||||
/// Illuminates the light if it is not active, extinguishes it if it is active.
|
/// Illuminates the light if it is not active, extinguishes it if it is active.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>True if the light's status was toggled, false otherwise.</returns>
|
/// <returns>True if the light's status was toggled, false otherwise.</returns>
|
||||||
public bool ToggleStatus(EntityUiduser)
|
public bool ToggleStatus(EntityUid user)
|
||||||
{
|
{
|
||||||
if (!EntitySystem.Get<ActionBlockerSystem>().CanUse(user)) return false;
|
if (!EntitySystem.Get<ActionBlockerSystem>().CanUse(user)) return false;
|
||||||
return Activated ? TurnOff() : TurnOn(user);
|
return Activated ? TurnOff() : TurnOn(user);
|
||||||
@@ -128,7 +128,7 @@ namespace Content.Server.Light.Components
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TurnOn(EntityUiduser)
|
public bool TurnOn(EntityUid user)
|
||||||
{
|
{
|
||||||
if (Activated)
|
if (Activated)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ namespace Content.Server.Light.EntitySystems
|
|||||||
args.IsHot = component.CurrentState == SmokableState.Lit;
|
args.IsHot = component.CurrentState == SmokableState.Lit;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Ignite(MatchstickComponent component, EntityUiduser)
|
public void Ignite(MatchstickComponent component, EntityUid user)
|
||||||
{
|
{
|
||||||
// Play Sound
|
// Play Sound
|
||||||
SoundSystem.Play(
|
SoundSystem.Play(
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ namespace Content.Server.Medical.Components
|
|||||||
UserInterface?.Open(actor.PlayerSession);
|
UserInterface?.Open(actor.PlayerSession);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InsertBody(EntityUiduser)
|
public void InsertBody(EntityUid user)
|
||||||
{
|
{
|
||||||
_bodyContainer.Insert(user);
|
_bodyContainer.Insert(user);
|
||||||
UpdateUserInterface();
|
UpdateUserInterface();
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ namespace Content.Server.PDA
|
|||||||
UpdatePDAUserInterface(pda);
|
UpdatePDAUserInterface(pda);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool OpenUI(PDAComponent pda, EntityUiduser)
|
private bool OpenUI(PDAComponent pda, EntityUid user)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(user, out ActorComponent? actor))
|
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(user, out ActorComponent? actor))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ namespace Content.Server.PneumaticCannon
|
|||||||
args.Verbs.Add(ejectItems);
|
args.Verbs.Add(ejectItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TryRemoveGasTank(PneumaticCannonComponent component, EntityUiduser)
|
public void TryRemoveGasTank(PneumaticCannonComponent component, EntityUid user)
|
||||||
{
|
{
|
||||||
if (component.GasTankSlot.ContainedEntity == null)
|
if (component.GasTankSlot.ContainedEntity == null)
|
||||||
{
|
{
|
||||||
@@ -328,7 +328,7 @@ namespace Content.Server.PneumaticCannon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TryEjectAllItems(PneumaticCannonComponent component, EntityUiduser)
|
public void TryEjectAllItems(PneumaticCannonComponent component, EntityUid user)
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<ServerStorageComponent?>(component.Owner, out var storage))
|
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<ServerStorageComponent?>(component.Owner, out var storage))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ namespace Content.Server.Power.Components
|
|||||||
/// This will remove the item directly into the user's hand / floor
|
/// This will remove the item directly into the user's hand / floor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="user"></param>
|
/// <param name="user"></param>
|
||||||
public void RemoveItem(EntityUiduser)
|
public void RemoveItem(EntityUid user)
|
||||||
{
|
{
|
||||||
var heldItem = Container.ContainedEntity;
|
var heldItem = Container.ContainedEntity;
|
||||||
if (heldItem == null)
|
if (heldItem == null)
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ namespace Content.Server.Radio.Components
|
|||||||
_chatManager.EntitySay(Owner, message);
|
_chatManager.EntitySay(Owner, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Use(EntityUiduser)
|
public bool Use(EntityUid user)
|
||||||
{
|
{
|
||||||
RadioOn = !RadioOn;
|
RadioOn = !RadioOn;
|
||||||
|
|
||||||
@@ -79,13 +79,13 @@ namespace Content.Server.Radio.Components
|
|||||||
return Use(eventArgs.User);
|
return Use(eventArgs.User);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanListen(string message, EntityUidsource)
|
public bool CanListen(string message, EntityUid source)
|
||||||
{
|
{
|
||||||
return RadioOn &&
|
return RadioOn &&
|
||||||
Owner.InRangeUnobstructed(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(source).Coordinates, range: ListenRange);
|
Owner.InRangeUnobstructed(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(source).Coordinates, range: ListenRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Receive(string message, int channel, EntityUidspeaker)
|
public void Receive(string message, int channel, EntityUid speaker)
|
||||||
{
|
{
|
||||||
if (RadioOn)
|
if (RadioOn)
|
||||||
{
|
{
|
||||||
@@ -93,12 +93,12 @@ namespace Content.Server.Radio.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Listen(string message, EntityUidspeaker)
|
public void Listen(string message, EntityUid speaker)
|
||||||
{
|
{
|
||||||
Broadcast(message, speaker);
|
Broadcast(message, speaker);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Broadcast(string message, EntityUidspeaker)
|
public void Broadcast(string message, EntityUid speaker)
|
||||||
{
|
{
|
||||||
_radioSystem.SpreadMessage(this, speaker, message, BroadcastFrequency);
|
_radioSystem.SpreadMessage(this, speaker, message, BroadcastFrequency);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
|
||||||
namespace Content.Server.Radio.Components
|
namespace Content.Server.Radio.Components
|
||||||
{
|
{
|
||||||
@@ -10,8 +10,8 @@ namespace Content.Server.Radio.Components
|
|||||||
{
|
{
|
||||||
int ListenRange { get; }
|
int ListenRange { get; }
|
||||||
|
|
||||||
bool CanListen(string message, EntityUidsource);
|
bool CanListen(string message, EntityUid source);
|
||||||
|
|
||||||
void Listen(string message, EntityUidspeaker);
|
void Listen(string message, EntityUid speaker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using Robust.Shared.GameObjects;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Content.Server.Radio.Components
|
namespace Content.Server.Radio.Components
|
||||||
{
|
{
|
||||||
@@ -6,8 +7,8 @@ namespace Content.Server.Radio.Components
|
|||||||
{
|
{
|
||||||
IReadOnlyList<int> Channels { get; }
|
IReadOnlyList<int> Channels { get; }
|
||||||
|
|
||||||
void Receive(string message, int channel, EntityUidspeaker);
|
void Receive(string message, int channel, EntityUid speaker);
|
||||||
|
|
||||||
void Broadcast(string message, EntityUidspeaker);
|
void Broadcast(string message, EntityUid speaker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ namespace Content.Server.Rotatable
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Replace a flippable entity with it's flipped / mirror-symmetric entity.
|
/// Replace a flippable entity with it's flipped / mirror-symmetric entity.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void TryFlip(FlippableComponent component, EntityUiduser)
|
public static void TryFlip(FlippableComponent component, EntityUid user)
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out IPhysBody? physics) &&
|
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out IPhysBody? physics) &&
|
||||||
physics.BodyType == BodyType.Static)
|
physics.BodyType == BodyType.Static)
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ namespace Content.Server.Sandbox
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpgradeId(EntityUidid)
|
void UpgradeId(EntityUid id)
|
||||||
{
|
{
|
||||||
var accessSystem = EntitySystem.Get<AccessSystem>();
|
var accessSystem = EntitySystem.Get<AccessSystem>();
|
||||||
accessSystem.TrySetTags(id, allAccess);
|
accessSystem.TrySetTags(id, allAccess);
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
if (dockingFixture == null)
|
if (dockingFixture == null)
|
||||||
{
|
{
|
||||||
DebugTools.Assert(false);
|
DebugTools.Assert(false);
|
||||||
Logger.ErrorS("docking", $"Found null fixture on {((IComponent) body).Owner)}"
|
Logger.ErrorS("docking", $"Found null fixture on {((IComponent) body).OwnerUid}");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
if (otherDockingFixture == null)
|
if (otherDockingFixture == null)
|
||||||
{
|
{
|
||||||
DebugTools.Assert(false);
|
DebugTools.Assert(false);
|
||||||
Logger.ErrorS("docking", $"Found null docking fixture on {ent)}"
|
Logger.ErrorS("docking", $"Found null docking fixture on {ent}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,8 +200,8 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
dockA.DockedWith = null;
|
dockA.DockedWith = null;
|
||||||
|
|
||||||
// If these grids are ever invalid then need to look at fixing ordering for unanchored events elsewhere.
|
// If these grids are ever invalid then need to look at fixing ordering for unanchored events elsewhere.
|
||||||
var gridAUid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(((IComponent) dockA).Owner).GridID).GridEntityId;
|
var gridAUid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(((IComponent) dockA).OwnerUid).GridID).GridEntityId;
|
||||||
var gridBUid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(((IComponent) dockB).Owner).GridID).GridEntityId;
|
var gridBUid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(((IComponent) dockB).OwnerUid).GridID).GridEntityId;
|
||||||
|
|
||||||
var msg = new UndockEvent
|
var msg = new UndockEvent
|
||||||
{
|
{
|
||||||
@@ -211,8 +211,8 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
GridBUid = gridBUid,
|
GridBUid = gridBUid,
|
||||||
};
|
};
|
||||||
|
|
||||||
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockA).Owner, msg, false);
|
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockA).OwnerUid, msg, false);
|
||||||
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockB).Owner, msg, false);
|
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockB).OwnerUid, msg, false);
|
||||||
EntityManager.EventBus.RaiseEvent(EventSource.Local, msg);
|
EntityManager.EventBus.RaiseEvent(EventSource.Local, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,8 +308,8 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
|
|
||||||
// We could also potentially use a prismatic joint? Depending if we want clamps that can extend or whatever
|
// We could also potentially use a prismatic joint? Depending if we want clamps that can extend or whatever
|
||||||
|
|
||||||
var dockAXform = EntityManager.GetComponent<TransformComponent>(((IComponent) dockA).Owner);
|
var dockAXform = EntityManager.GetComponent<TransformComponent>(((IComponent) dockA).OwnerUid);
|
||||||
var dockBXform = EntityManager.GetComponent<TransformComponent>(((IComponent) dockB).Owner);
|
var dockBXform = EntityManager.GetComponent<TransformComponent>(((IComponent) dockB).OwnerUid);
|
||||||
|
|
||||||
var gridA = _mapManager.GetGrid(dockAXform.GridID).GridEntityId;
|
var gridA = _mapManager.GetGrid(dockAXform.GridID).GridEntityId;
|
||||||
var gridB = _mapManager.GetGrid(dockBXform.GridID).GridEntityId;
|
var gridB = _mapManager.GetGrid(dockBXform.GridID).GridEntityId;
|
||||||
@@ -344,13 +344,13 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
dockA.DockJoint = joint;
|
dockA.DockJoint = joint;
|
||||||
dockB.DockJoint = joint;
|
dockB.DockJoint = joint;
|
||||||
|
|
||||||
if (EntityManager.TryGetComponent(((IComponent) dockA).Owner, out ServerDoorComponent? doorA))
|
if (EntityManager.TryGetComponent(((IComponent) dockA).OwnerUid, out ServerDoorComponent? doorA))
|
||||||
{
|
{
|
||||||
doorA.ChangeAirtight = false;
|
doorA.ChangeAirtight = false;
|
||||||
doorA.Open();
|
doorA.Open();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EntityManager.TryGetComponent(((IComponent) dockB).Owner, out ServerDoorComponent? doorB))
|
if (EntityManager.TryGetComponent(((IComponent) dockB).OwnerUid, out ServerDoorComponent? doorB))
|
||||||
{
|
{
|
||||||
doorB.ChangeAirtight = false;
|
doorB.ChangeAirtight = false;
|
||||||
doorB.Open();
|
doorB.Open();
|
||||||
@@ -364,8 +364,8 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
GridBUid = gridB,
|
GridBUid = gridB,
|
||||||
};
|
};
|
||||||
|
|
||||||
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockA).Owner, msg, false);
|
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockA).OwnerUid, msg, false);
|
||||||
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockB).Owner, msg, false);
|
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockB).OwnerUid, msg, false);
|
||||||
EntityManager.EventBus.RaiseEvent(EventSource.Local, msg);
|
EntityManager.EventBus.RaiseEvent(EventSource.Local, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -374,8 +374,8 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void TryDock(DockingComponent dockA, DockingComponent dockB)
|
private void TryDock(DockingComponent dockA, DockingComponent dockB)
|
||||||
{
|
{
|
||||||
if (!EntityManager.TryGetComponent(((IComponent) dockA).Owner, out PhysicsComponent? bodyA) ||
|
if (!EntityManager.TryGetComponent(((IComponent) dockA).OwnerUid, out PhysicsComponent? bodyA) ||
|
||||||
!EntityManager.TryGetComponent(((IComponent) dockB).Owner, out PhysicsComponent? bodyB) ||
|
!EntityManager.TryGetComponent(((IComponent) dockB).OwnerUid, out PhysicsComponent? bodyB) ||
|
||||||
!dockA.Enabled ||
|
!dockA.Enabled ||
|
||||||
!dockB.Enabled)
|
!dockB.Enabled)
|
||||||
{
|
{
|
||||||
@@ -425,13 +425,13 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EntityManager.TryGetComponent(((IComponent) dock).Owner, out ServerDoorComponent? doorA))
|
if (EntityManager.TryGetComponent(((IComponent) dock).OwnerUid, out ServerDoorComponent? doorA))
|
||||||
{
|
{
|
||||||
doorA.ChangeAirtight = true;
|
doorA.ChangeAirtight = true;
|
||||||
doorA.Close();
|
doorA.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EntityManager.TryGetComponent(((IComponent) dock.DockedWith).Owner, out ServerDoorComponent? doorB))
|
if (EntityManager.TryGetComponent(((IComponent) dock.DockedWith).OwnerUid, out ServerDoorComponent? doorB))
|
||||||
{
|
{
|
||||||
doorB.ChangeAirtight = true;
|
doorB.ChangeAirtight = true;
|
||||||
doorB.Close();
|
doorB.Close();
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
|
|
||||||
private void OnGridInit(GridInitializeEvent ev)
|
private void OnGridInit(GridInitializeEvent ev)
|
||||||
{
|
{
|
||||||
ev.EntityUid).EnsureComponent<ShuttleComponent>(
|
EntityManager.EnsureComponent<ShuttleComponent>(ev.EntityUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnShuttleStartup(EntityUid uid, ShuttleComponent component, ComponentStartup args)
|
private void OnShuttleStartup(EntityUid uid, ShuttleComponent component, ComponentStartup args)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
@@ -71,7 +71,7 @@ namespace Content.Server.Singularity.Components
|
|||||||
Timer.SpawnRepeating(1000, () => { SharedEnergyPool--;}, _powerDecreaseCancellationTokenSource.Token);
|
Timer.SpawnRepeating(1000, () => { SharedEnergyPool--;}, _powerDecreaseCancellationTokenSource.Token);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanRepell(EntityUidtoRepell)
|
public bool CanRepell(EntityUid toRepell)
|
||||||
{
|
{
|
||||||
var powerNeeded = 1;
|
var powerNeeded = 1;
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<ServerSingularityComponent?>(toRepell, out var singularityComponent))
|
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<ServerSingularityComponent?>(toRepell, out var singularityComponent))
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace Content.Server.Singularity.Components
|
|||||||
private Tuple<Direction, ContainmentFieldConnection>? _connection1;
|
private Tuple<Direction, ContainmentFieldConnection>? _connection1;
|
||||||
private Tuple<Direction, ContainmentFieldConnection>? _connection2;
|
private Tuple<Direction, ContainmentFieldConnection>? _connection2;
|
||||||
|
|
||||||
public bool CanRepell(EntityUidtoRepell) => _connection1?.Item2?.CanRepell(toRepell) == true ||
|
public bool CanRepell(EntityUid toRepell) => _connection1?.Item2?.CanRepell(toRepell) == true ||
|
||||||
_connection2?.Item2?.CanRepell(toRepell) == true;
|
_connection2?.Item2?.CanRepell(toRepell) == true;
|
||||||
|
|
||||||
public void OnAnchoredChanged()
|
public void OnAnchoredChanged()
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ namespace Content.Server.Storage.Components
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="user"></param>
|
/// <param name="user"></param>
|
||||||
/// <returns>True if user recieved item</returns>
|
/// <returns>True if user recieved item</returns>
|
||||||
public bool TryGetItem(EntityUiduser)
|
public bool TryGetItem(EntityUid user)
|
||||||
{
|
{
|
||||||
if (_itemContainer.ContainedEntity == null)
|
if (_itemContainer.ContainedEntity == null)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ namespace Content.Server.Stunnable
|
|||||||
comp.Activated = false;
|
comp.Activated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TurnOn(StunbatonComponent comp, EntityUiduser)
|
private void TurnOn(StunbatonComponent comp, EntityUid user)
|
||||||
{
|
{
|
||||||
if (comp.Activated)
|
if (comp.Activated)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ namespace Content.Server.Tabletop
|
|||||||
SpawnPiecesRow(session, entityManager, "White", new MapCoordinates(x, y - 7 * separation, mapId), separation);
|
SpawnPiecesRow(session, entityManager, "White", new MapCoordinates(x, y - 7 * separation, mapId), separation);
|
||||||
|
|
||||||
// Extra queens
|
// Extra queens
|
||||||
EntityUidtempQualifier = entityManager.SpawnEntity("BlackQueen", new MapCoordinates(x + 9 * separation + 9f / 32, y - 3 * separation, mapId));
|
EntityUid tempQualifier = entityManager.SpawnEntity("BlackQueen", new MapCoordinates(x + 9 * separation + 9f / 32, y - 3 * separation, mapId));
|
||||||
session.Entities.Add(tempQualifier);
|
session.Entities.Add(tempQualifier);
|
||||||
EntityUidtempQualifier1 = entityManager.SpawnEntity("WhiteQueen", new MapCoordinates(x + 9 * separation + 9f / 32, y - 4 * separation, mapId));
|
EntityUid tempQualifier1 = entityManager.SpawnEntity("WhiteQueen", new MapCoordinates(x + 9 * separation + 9f / 32, y - 4 * separation, mapId));
|
||||||
session.Entities.Add(tempQualifier1);
|
session.Entities.Add(tempQualifier1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,23 +53,23 @@ namespace Content.Server.Tabletop
|
|||||||
switch (piecesRow[i])
|
switch (piecesRow[i])
|
||||||
{
|
{
|
||||||
case 'r':
|
case 'r':
|
||||||
EntityUidtempQualifier = entityManager.SpawnEntity(color + "Rook", new MapCoordinates(x + i * separation, y, mapId));
|
EntityUid tempQualifier = entityManager.SpawnEntity(color + "Rook", new MapCoordinates(x + i * separation, y, mapId));
|
||||||
session.Entities.Add(tempQualifier);
|
session.Entities.Add(tempQualifier);
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
EntityUidtempQualifier1 = entityManager.SpawnEntity(color + "Knight", new MapCoordinates(x + i * separation, y, mapId));
|
EntityUid tempQualifier1 = entityManager.SpawnEntity(color + "Knight", new MapCoordinates(x + i * separation, y, mapId));
|
||||||
session.Entities.Add(tempQualifier1);
|
session.Entities.Add(tempQualifier1);
|
||||||
break;
|
break;
|
||||||
case 'b':
|
case 'b':
|
||||||
EntityUidtempQualifier2 = entityManager.SpawnEntity(color + "Bishop", new MapCoordinates(x + i * separation, y, mapId));
|
EntityUid tempQualifier2 = entityManager.SpawnEntity(color + "Bishop", new MapCoordinates(x + i * separation, y, mapId));
|
||||||
session.Entities.Add(tempQualifier2);
|
session.Entities.Add(tempQualifier2);
|
||||||
break;
|
break;
|
||||||
case 'q':
|
case 'q':
|
||||||
EntityUidtempQualifier3 = entityManager.SpawnEntity(color + "Queen", new MapCoordinates(x + i * separation, y, mapId));
|
EntityUid tempQualifier3 = entityManager.SpawnEntity(color + "Queen", new MapCoordinates(x + i * separation, y, mapId));
|
||||||
session.Entities.Add(tempQualifier3);
|
session.Entities.Add(tempQualifier3);
|
||||||
break;
|
break;
|
||||||
case 'k':
|
case 'k':
|
||||||
EntityUidtempQualifier4 = entityManager.SpawnEntity(color + "King", new MapCoordinates(x + i * separation, y, mapId));
|
EntityUid tempQualifier4 = entityManager.SpawnEntity(color + "King", new MapCoordinates(x + i * separation, y, mapId));
|
||||||
session.Entities.Add(tempQualifier4);
|
session.Entities.Add(tempQualifier4);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,7 @@ namespace Content.Server.Tabletop
|
|||||||
|
|
||||||
for (int i = 0; i < 8; i++)
|
for (int i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
EntityUidtempQualifier = entityManager.SpawnEntity(color + "Pawn", new MapCoordinates(x + i * separation, y, mapId));
|
EntityUid tempQualifier = entityManager.SpawnEntity(color + "Pawn", new MapCoordinates(x + i * separation, y, mapId));
|
||||||
session.Entities.Add(tempQualifier);
|
session.Entities.Add(tempQualifier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,43 +35,43 @@ namespace Content.Server.Tabletop
|
|||||||
var center = session.Position;
|
var center = session.Position;
|
||||||
|
|
||||||
// Red pieces.
|
// Red pieces.
|
||||||
EntityUidtempQualifier = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x1, -y1));
|
EntityUid tempQualifier = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x1, -y1));
|
||||||
session.Entities.Add(tempQualifier);
|
session.Entities.Add(tempQualifier);
|
||||||
EntityUidtempQualifier1 = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x1, -y2));
|
EntityUid tempQualifier1 = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x1, -y2));
|
||||||
session.Entities.Add(tempQualifier1);
|
session.Entities.Add(tempQualifier1);
|
||||||
EntityUidtempQualifier2 = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x2, -y1));
|
EntityUid tempQualifier2 = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x2, -y1));
|
||||||
session.Entities.Add(tempQualifier2);
|
session.Entities.Add(tempQualifier2);
|
||||||
EntityUidtempQualifier3 = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x2, -y2));
|
EntityUid tempQualifier3 = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x2, -y2));
|
||||||
session.Entities.Add(tempQualifier3);
|
session.Entities.Add(tempQualifier3);
|
||||||
|
|
||||||
// Green pieces.
|
// Green pieces.
|
||||||
EntityUidtempQualifier4 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x1, -y1));
|
EntityUid tempQualifier4 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x1, -y1));
|
||||||
session.Entities.Add(tempQualifier4);
|
session.Entities.Add(tempQualifier4);
|
||||||
EntityUidtempQualifier5 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x1, -y2));
|
EntityUid tempQualifier5 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x1, -y2));
|
||||||
session.Entities.Add(tempQualifier5);
|
session.Entities.Add(tempQualifier5);
|
||||||
EntityUidtempQualifier6 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x2, -y1));
|
EntityUid tempQualifier6 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x2, -y1));
|
||||||
session.Entities.Add(tempQualifier6);
|
session.Entities.Add(tempQualifier6);
|
||||||
EntityUidtempQualifier7 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x2, -y2));
|
EntityUid tempQualifier7 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x2, -y2));
|
||||||
session.Entities.Add(tempQualifier7);
|
session.Entities.Add(tempQualifier7);
|
||||||
|
|
||||||
// Yellow pieces.
|
// Yellow pieces.
|
||||||
EntityUidtempQualifier8 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x1, y1));
|
EntityUid tempQualifier8 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x1, y1));
|
||||||
session.Entities.Add(tempQualifier8);
|
session.Entities.Add(tempQualifier8);
|
||||||
EntityUidtempQualifier9 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x1, y2));
|
EntityUid tempQualifier9 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x1, y2));
|
||||||
session.Entities.Add(tempQualifier9);
|
session.Entities.Add(tempQualifier9);
|
||||||
EntityUidtempQualifier10 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x2, y1));
|
EntityUid tempQualifier10 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x2, y1));
|
||||||
session.Entities.Add(tempQualifier10);
|
session.Entities.Add(tempQualifier10);
|
||||||
EntityUidtempQualifier11 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x2, y2));
|
EntityUid tempQualifier11 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x2, y2));
|
||||||
session.Entities.Add(tempQualifier11);
|
session.Entities.Add(tempQualifier11);
|
||||||
|
|
||||||
// Blue pieces.
|
// Blue pieces.
|
||||||
EntityUidtempQualifier12 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x1, y1));
|
EntityUid tempQualifier12 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x1, y1));
|
||||||
session.Entities.Add(tempQualifier12);
|
session.Entities.Add(tempQualifier12);
|
||||||
EntityUidtempQualifier13 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x1, y2));
|
EntityUid tempQualifier13 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x1, y2));
|
||||||
session.Entities.Add(tempQualifier13);
|
session.Entities.Add(tempQualifier13);
|
||||||
EntityUidtempQualifier14 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x2, y1));
|
EntityUid tempQualifier14 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x2, y1));
|
||||||
session.Entities.Add(tempQualifier14);
|
session.Entities.Add(tempQualifier14);
|
||||||
EntityUidtempQualifier15 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x2, y2));
|
EntityUid tempQualifier15 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x2, y2));
|
||||||
session.Entities.Add(tempQualifier15);
|
session.Entities.Add(tempQualifier15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ namespace Content.Server.Traitor.Uplink
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private EntityUid FindUplinkTarget(EntityUiduser)
|
private EntityUid FindUplinkTarget(EntityUid user)
|
||||||
{
|
{
|
||||||
// Try to find PDA in inventory
|
// Try to find PDA in inventory
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(user, out InventoryComponent? inventory))
|
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(user, out InventoryComponent? inventory))
|
||||||
|
|||||||
@@ -83,10 +83,10 @@ namespace Content.Server.UserInterface
|
|||||||
// If we've gotten this far, fire a cancellable event that indicates someone is about to activate this.
|
// 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).
|
// This is so that stuff can require further conditions (like power).
|
||||||
var oae = new ActivatableUIOpenAttemptEvent(user);
|
var oae = new ActivatableUIOpenAttemptEvent(user);
|
||||||
RaiseLocalEvent(((IComponent) aui).Owner, oae, false);
|
RaiseLocalEvent(((IComponent) aui).OwnerUid, oae, false);
|
||||||
if (oae.Cancelled) return false;
|
if (oae.Cancelled) return false;
|
||||||
|
|
||||||
SetCurrentSingleUser(((IComponent) aui).Owner, actor.PlayerSession, aui);
|
SetCurrentSingleUser(((IComponent) aui).OwnerUid, actor.PlayerSession, aui);
|
||||||
ui.Toggle(actor.PlayerSession);
|
ui.Toggle(actor.PlayerSession);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -133,8 +133,8 @@ namespace Content.Server.UserInterface
|
|||||||
|
|
||||||
public class ActivatableUIOpenAttemptEvent : CancellableEntityEventArgs
|
public class ActivatableUIOpenAttemptEvent : CancellableEntityEventArgs
|
||||||
{
|
{
|
||||||
public EntityUidUser { get; }
|
public EntityUid User { get; }
|
||||||
public ActivatableUIOpenAttemptEvent(EntityUidwho)
|
public ActivatableUIOpenAttemptEvent(EntityUid who)
|
||||||
{
|
{
|
||||||
User = who;
|
User = who;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.Administration;
|
using Content.Server.Administration;
|
||||||
using Content.Shared.Administration;
|
using Content.Shared.Administration;
|
||||||
@@ -29,12 +29,12 @@ namespace Content.Server.Verbs.Commands
|
|||||||
var verbSystem = EntitySystem.Get<SharedVerbSystem>();
|
var verbSystem = EntitySystem.Get<SharedVerbSystem>();
|
||||||
|
|
||||||
// get the 'player' entity (defaulting to command user, otherwise uses a uid)
|
// get the 'player' entity (defaulting to command user, otherwise uses a uid)
|
||||||
EntityUid playerEntity = null;
|
EntityUid playerEntity = default;
|
||||||
if (!int.TryParse(args[0], out var intPlayerUid))
|
if (!int.TryParse(args[0], out var intPlayerUid))
|
||||||
{
|
{
|
||||||
if (args[0] == "self" && shell.Player?.AttachedEntity != null)
|
if (args[0] == "self" && shell.Player?.AttachedEntity != null)
|
||||||
{
|
{
|
||||||
playerEntity = shell.Player.AttachedEntity;
|
playerEntity = shell.Player.AttachedEntityUid.Value;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -54,14 +54,14 @@ namespace Content.Server.Verbs.Commands
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (playerEntity == null)
|
if (playerEntity == default)
|
||||||
{
|
{
|
||||||
shell.WriteError(Loc.GetString("invoke-verb-command-invalid-player-entity"));
|
shell.WriteError(Loc.GetString("invoke-verb-command-invalid-player-entity"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var entUid = new EntityUid(intUid);
|
var entUid = new EntityUid(intUid);
|
||||||
if (!entityManager.EntityExists(entUid)
|
if (!entityManager.EntityExists(entUid))
|
||||||
{
|
{
|
||||||
shell.WriteError(Loc.GetString("invoke-verb-command-invalid-target-entity"));
|
shell.WriteError(Loc.GetString("invoke-verb-command-invalid-target-entity"));
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ namespace Content.Server.Weapon.Ranged.Ammunition.Components
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool TryUse(EntityUiduser)
|
private bool TryUse(EntityUid user)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(user, out HandsComponent? handsComponent))
|
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(user, out HandsComponent? handsComponent))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveMagazine(EntityUiduser)
|
public void RemoveMagazine(EntityUid user)
|
||||||
{
|
{
|
||||||
var mag = MagazineContainer.ContainedEntity;
|
var mag = MagazineContainer.ContainedEntity;
|
||||||
|
|
||||||
@@ -384,7 +384,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InsertMagazine(EntityUid user, EntityUidmagazine)
|
public void InsertMagazine(EntityUid user, EntityUid magazine)
|
||||||
{
|
{
|
||||||
SoundSystem.Play(Filter.Pvs(Owner), _soundMagInsert.GetSound(), Owner, AudioParams.Default.WithVolume(-2));
|
SoundSystem.Play(Filter.Pvs(Owner), _soundMagInsert.GetSound(), Owner, AudioParams.Default.WithVolume(-2));
|
||||||
Owner.PopupMessage(user, Loc.GetString("server-magazine-barrel-component-interact-using-success"));
|
Owner.PopupMessage(user, Loc.GetString("server-magazine-barrel-component-interact-using-success"));
|
||||||
|
|||||||
Reference in New Issue
Block a user