fixes a bunch of warnings
This commit is contained in:
@@ -18,7 +18,6 @@ namespace Content.Client.AI
|
||||
#if DEBUG
|
||||
public class ClientPathfindingDebugSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IOverlayManager _overlayManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
|
||||
@@ -14,9 +14,6 @@ namespace Content.Client.Body.UI
|
||||
[ViewVariables]
|
||||
private BodyScannerDisplay? _display;
|
||||
|
||||
[ViewVariables]
|
||||
private EntityUid _entity;
|
||||
|
||||
public BodyScannerBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey) { }
|
||||
|
||||
protected override void Open()
|
||||
@@ -43,7 +40,7 @@ namespace Content.Client.Body.UI
|
||||
throw new ArgumentException($"Received an invalid entity with id {scannerState.Uid} for body scanner with id {Owner.Owner} at {entMan.GetComponent<TransformComponent>(Owner.Owner).MapPosition}");
|
||||
}
|
||||
|
||||
_display?.UpdateDisplay(_entity);
|
||||
_display?.UpdateDisplay(scannerState.Uid);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Content.Client.Body.UI
|
||||
|
||||
public void UpdateDisplay(EntityUid entity)
|
||||
{
|
||||
if(entity == null)
|
||||
if(!entity.Valid)
|
||||
return;
|
||||
|
||||
_currentEntity = entity;
|
||||
@@ -125,12 +125,7 @@ namespace Content.Client.Body.UI
|
||||
|
||||
public void BodyPartOnItemSelected(ItemListSelectedEventArgs args)
|
||||
{
|
||||
if (_currentEntity == null)
|
||||
return;
|
||||
|
||||
var body = IoCManager.Resolve<IEntityManager>().GetComponentOrNull<SharedBodyComponent>(_currentEntity);
|
||||
|
||||
if (body == null)
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<SharedBodyComponent>(_currentEntity, out var body))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ namespace Content.Client.ContextMenu.UI
|
||||
|
||||
// Get the first entity in the sub-menus
|
||||
var entity = GetFirstEntityOrNull(element.SubMenu);
|
||||
if (entity == null)
|
||||
if (!entity.Valid)
|
||||
{
|
||||
// This whole element has no associated entities. We should remove it
|
||||
element.Dispose();
|
||||
|
||||
@@ -4,10 +4,8 @@ using Robust.Client.Graphics;
|
||||
using Robust.Client.Utility;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.Maths;
|
||||
|
||||
namespace Content.Client.Decals
|
||||
{
|
||||
|
||||
@@ -99,8 +99,7 @@ namespace Content.Client.Hands
|
||||
_itemSlotManager.SetItemSlot(newButton, hand.HeldItem);
|
||||
|
||||
// Show blocked overlay if hand is blocked.
|
||||
newButton.Blocked.Visible =
|
||||
hand.HeldItem != null && IoCManager.Resolve<IEntityManager>().HasComponent<HandVirtualItemComponent>(hand.HeldItem);
|
||||
newButton.Blocked.Visible = IoCManager.Resolve<IEntityManager>().HasComponent<HandVirtualItemComponent>(hand.HeldItem);
|
||||
}
|
||||
|
||||
if (TryGetActiveHand(out var activeHand))
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Content.Client.Inventory
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_strippingMenu = new StrippingMenu($"{Loc.GetString("strippable-bound-user-interface-stripping-menu-title",("ownerName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Owner).EntityName))}");
|
||||
_strippingMenu = new StrippingMenu($"{Loc.GetString("strippable-bound-user-interface-stripping-menu-title",("ownerName", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Owner).EntityName))}");
|
||||
|
||||
_strippingMenu.OnClose += Close;
|
||||
_strippingMenu.OpenCentered();
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Content.Client.MedicalScanner.UI
|
||||
}
|
||||
else
|
||||
{
|
||||
text.Append($"{Loc.GetString("medical-scanner-window-entity-health-text", ("entityName", Name: entities.GetComponent<MetaDataComponent>(state.Entity.Value).EntityName))}\n");
|
||||
text.Append($"{Loc.GetString("medical-scanner-window-entity-health-text", ("entityName", entities.GetComponent<MetaDataComponent>(state.Entity.Value).EntityName))}\n");
|
||||
|
||||
var totalDamage = state.DamagePerType.Values.Sum();
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Content.Server.AI.LoadBalancer
|
||||
|
||||
var entity = _request.Context.GetState<SelfState>().GetValue();
|
||||
|
||||
if (entity == null || !IoCManager.Resolve<IEntityManager>().HasComponent<AiControllerComponent>(entity))
|
||||
if (!IoCManager.Resolve<IEntityManager>().HasComponent<AiControllerComponent>(entity))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Content.Server.AI.Utility.Actions.Idle
|
||||
{
|
||||
var lastStorage = context.GetState<LastOpenedStorageState>().GetValue();
|
||||
|
||||
if (lastStorage == null)
|
||||
if (!lastStorage.Valid)
|
||||
{
|
||||
ActionOperators = new Queue<AiOperator>(new AiOperator[]
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.AI.Utility.Considerations.ActionBlocker
|
||||
{
|
||||
var self = context.GetState<SelfState>().GetValue();
|
||||
|
||||
if (self == null || !EntitySystem.Get<ActionBlockerSystem>().CanMove(self))
|
||||
if (!self.Valid || !EntitySystem.Get<ActionBlockerSystem>().CanMove(self))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.AI.Utility.Considerations.Combat.Melee
|
||||
{
|
||||
var target = context.GetState<WeaponEntityState>().GetValue();
|
||||
|
||||
if (target == null || !IoCManager.Resolve<IEntityManager>().TryGetComponent(target, out MeleeWeaponComponent? meleeWeaponComponent))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(target, out MeleeWeaponComponent? meleeWeaponComponent))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -10,14 +10,10 @@ namespace Content.Server.AI.Utility.Considerations.Combat.Melee
|
||||
{
|
||||
protected override float GetScore(Blackboard context)
|
||||
{
|
||||
var equipped = context.GetState<EquippedEntityState>().GetValue();
|
||||
|
||||
if (equipped == null)
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
return IoCManager.Resolve<IEntityManager>().HasComponent<MeleeWeaponComponent>(equipped) ? 1.0f : 0.0f;
|
||||
return IoCManager.Resolve<IEntityManager>()
|
||||
.HasComponent<MeleeWeaponComponent>(context.GetState<EquippedEntityState>().GetValue())
|
||||
? 1.0f
|
||||
: 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.AI.Utility.Considerations.Combat.Melee
|
||||
{
|
||||
var target = context.GetState<WeaponEntityState>().GetValue();
|
||||
|
||||
if (target == null || !IoCManager.Resolve<IEntityManager>().TryGetComponent(target, out MeleeWeaponComponent? meleeWeaponComponent))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(target, out MeleeWeaponComponent? meleeWeaponComponent))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.AI.Utility.Considerations.Combat
|
||||
{
|
||||
var target = context.GetState<TargetEntityState>().GetValue();
|
||||
|
||||
if (target == null || !IoCManager.Resolve<IEntityManager>().TryGetComponent(target, out DamageableComponent? damageableComponent))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(target, out DamageableComponent? damageableComponent))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.AI.Utility.Considerations.Combat
|
||||
{
|
||||
var target = context.GetState<TargetEntityState>().GetValue();
|
||||
|
||||
if (target == null || !IoCManager.Resolve<IEntityManager>().TryGetComponent(target, out MobStateComponent? mobState))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(target, out MobStateComponent? mobState))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.AI.Utility.Considerations.Combat
|
||||
{
|
||||
var target = context.GetState<TargetEntityState>().GetValue();
|
||||
|
||||
if (target == null || !IoCManager.Resolve<IEntityManager>().TryGetComponent(target, out MobStateComponent? mobState))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(target, out MobStateComponent? mobState))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Content.Server.AI.Utility.Considerations.Containers
|
||||
|
||||
var owner = context.GetState<SelfState>().GetValue();
|
||||
|
||||
if (owner == null)
|
||||
if (!owner.Valid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.AI.Utility.Considerations.Hands
|
||||
{
|
||||
var owner = context.GetState<SelfState>().GetValue();
|
||||
|
||||
if (owner == null || !IoCManager.Resolve<IEntityManager>().TryGetComponent(owner, out HandsComponent? handsComponent))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(owner, out HandsComponent? handsComponent))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Content.Server.AI.Utility.Considerations.Inventory
|
||||
// If not then check if we have a free hand
|
||||
var target = context.GetState<TargetEntityState>().GetValue();
|
||||
|
||||
if (target == null || !IoCManager.Resolve<IEntityManager>().HasComponent<ItemComponent>(target))
|
||||
if (!IoCManager.Resolve<IEntityManager>().HasComponent<ItemComponent>(target))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Content.Server.AI.Utility.Considerations.Inventory
|
||||
{
|
||||
var target = context.GetState<TargetEntityState>().GetValue();
|
||||
|
||||
if (target == null || !IoCManager.Resolve<IEntityManager>().HasComponent<ItemComponent>(target))
|
||||
if (!IoCManager.Resolve<IEntityManager>().HasComponent<ItemComponent>(target))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -13,8 +13,7 @@ namespace Content.Server.AI.Utility.Considerations.Nutrition.Drink
|
||||
{
|
||||
var target = context.GetState<TargetEntityState>().GetValue();
|
||||
|
||||
if (target == null
|
||||
|| IoCManager.Resolve<IEntityManager>().Deleted(target)
|
||||
if (IoCManager.Resolve<IEntityManager>().Deleted(target)
|
||||
|| !EntitySystem.Get<SolutionContainerSystem>().TryGetSolution(target, DrinkComponent.DefaultSolutionName, out var drink))
|
||||
{
|
||||
return 0.0f;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Content.Server.AI.Utility.Considerations.Nutrition.Drink
|
||||
{
|
||||
var owner = context.GetState<SelfState>().GetValue();
|
||||
|
||||
if (owner == null || !IoCManager.Resolve<IEntityManager>().TryGetComponent(owner, out ThirstComponent? thirst))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(owner, out ThirstComponent? thirst))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -13,8 +13,9 @@ namespace Content.Server.AI.Utility.Considerations.Nutrition.Food
|
||||
{
|
||||
var target = context.GetState<TargetEntityState>().GetValue();
|
||||
|
||||
if (target == null || !IoCManager.Resolve<IEntityManager>().TryGetComponent<FoodComponent?>(target, out var foodComp)
|
||||
|| !EntitySystem.Get<SolutionContainerSystem>().TryGetSolution(target, foodComp.SolutionName, out var food))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<FoodComponent?>(target, out var foodComp)
|
||||
|| !EntitySystem.Get<SolutionContainerSystem>()
|
||||
.TryGetSolution(target, foodComp.SolutionName, out var food))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Content.Server.AI.Utility.Considerations.Nutrition.Food
|
||||
{
|
||||
var owner = context.GetState<SelfState>().GetValue();
|
||||
|
||||
if (owner == null || !IoCManager.Resolve<IEntityManager>().TryGetComponent(owner, out HungerComponent? hunger))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(owner, out HungerComponent? hunger))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Content.Server.AI.Utility.Considerations.State
|
||||
}
|
||||
|
||||
context.GetStoredState(stateData, out StoredStateData<EntityUid> state);
|
||||
return state.GetValue() == null ? 1.0f : 0.0f;
|
||||
return state.GetValue().Valid ? 0.0f : 1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace Content.Server.AI.Utility
|
||||
internal sealed class NpcBehaviorManager : INpcBehaviorManager
|
||||
{
|
||||
[Dependency] private readonly IDynamicTypeFactory _typeFactory = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
private readonly NpcActionComparer _comparer = new();
|
||||
|
||||
|
||||
@@ -83,10 +83,10 @@ namespace Content.Server.Actions.Actions
|
||||
SoundSystem.Play(Filter.Pvs(args.Performer), PunchMissSound.GetSound(), args.Performer, AudioHelpers.WithVariation(0.025f));
|
||||
|
||||
args.Performer.PopupMessageOtherClients(Loc.GetString("disarm-action-popup-message-other-clients",
|
||||
("performerName", Name: entMan.GetComponent<MetaDataComponent>(args.Performer).EntityName),
|
||||
("targetName", Name: entMan.GetComponent<MetaDataComponent>(args.Target).EntityName)));
|
||||
("performerName", entMan.GetComponent<MetaDataComponent>(args.Performer).EntityName),
|
||||
("targetName", entMan.GetComponent<MetaDataComponent>(args.Target).EntityName)));
|
||||
args.Performer.PopupMessageCursor(Loc.GetString("disarm-action-popup-message-cursor",
|
||||
("targetName", Name: entMan.GetComponent<MetaDataComponent>(args.Target).EntityName)));
|
||||
("targetName", entMan.GetComponent<MetaDataComponent>(args.Target).EntityName)));
|
||||
system.SendLunge(angle, args.Performer);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
{
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly SpreaderSystem _spreaderSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace Content.Server.Body.Components
|
||||
else // If surgery cannot be performed, show message saying so.
|
||||
{
|
||||
eventArgs.Target?.PopupMessage(eventArgs.User,
|
||||
Loc.GetString("mechanism-component-no-way-to-install-message", ("partName", Name: _entities.GetComponent<MetaDataComponent>(Owner).EntityName)));
|
||||
Loc.GetString("mechanism-component-no-way-to-install-message", ("partName", _entities.GetComponent<MetaDataComponent>(Owner).EntityName)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace Content.Server.Body.Components
|
||||
if (!OptionsCache.TryGetValue(key, out var targetObject))
|
||||
{
|
||||
BodyCache.Owner.PopupMessage(PerformerCache.Value,
|
||||
Loc.GetString("mechanism-component-no-useful-way-to-use-message",("partName", Name: _entities.GetComponent<MetaDataComponent>(Owner).EntityName)));
|
||||
Loc.GetString("mechanism-component-no-useful-way-to-use-message",("partName", _entities.GetComponent<MetaDataComponent>(Owner).EntityName)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -115,8 +115,6 @@ public class LungSystem : EntitySystem
|
||||
// TODO Jesus Christ make this event based.
|
||||
if (mech.Body != null &&
|
||||
EntityManager.TryGetComponent((mech.Body).Owner, out InternalsComponent? internals) &&
|
||||
internals.BreathToolEntity != null &&
|
||||
internals.GasTankEntity != null &&
|
||||
EntityManager.TryGetComponent(internals.BreathToolEntity, out BreathToolComponent? breathTool) &&
|
||||
breathTool.IsFunctional &&
|
||||
EntityManager.TryGetComponent(internals.GasTankEntity, out GasTankComponent? gasTank))
|
||||
|
||||
@@ -684,7 +684,7 @@ namespace Content.Server.Botany.Components
|
||||
}
|
||||
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-already-seeded-message",
|
||||
("name", Name: _entMan.GetComponent<MetaDataComponent>(Owner).EntityName)));
|
||||
("name", _entMan.GetComponent<MetaDataComponent>(Owner).EntityName)));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -693,9 +693,9 @@ namespace Content.Server.Botany.Components
|
||||
if (WeedLevel > 0)
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-remove-weeds-message",
|
||||
("name", Name: _entMan.GetComponent<MetaDataComponent>(Owner).EntityName)));
|
||||
("name", _entMan.GetComponent<MetaDataComponent>(Owner).EntityName)));
|
||||
user.PopupMessageOtherClients(Loc.GetString("plant-holder-component-remove-weeds-others-message",
|
||||
("otherName", Name: _entMan.GetComponent<MetaDataComponent>(user).EntityName)));
|
||||
("otherName", _entMan.GetComponent<MetaDataComponent>(user).EntityName)));
|
||||
WeedLevel = 0;
|
||||
UpdateSprite();
|
||||
}
|
||||
@@ -712,9 +712,9 @@ namespace Content.Server.Botany.Components
|
||||
if (Seed != null)
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-remove-plant-message",
|
||||
("name", Name: _entMan.GetComponent<MetaDataComponent>(Owner).EntityName)));
|
||||
("name", _entMan.GetComponent<MetaDataComponent>(Owner).EntityName)));
|
||||
user.PopupMessageOtherClients(Loc.GetString("plant-holder-component-remove-plant-others-message",
|
||||
("name", Name: _entMan.GetComponent<MetaDataComponent>(user).EntityName)));
|
||||
("name", _entMan.GetComponent<MetaDataComponent>(user).EntityName)));
|
||||
RemovePlant();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Content.Server.Botany.Components
|
||||
|
||||
if (_entMan.TryGetComponent(eventArgs.Using, out ProduceComponent? produce) && produce.Seed != null)
|
||||
{
|
||||
eventArgs.User.PopupMessageCursor(Loc.GetString("seed-extractor-component-interact-message",("name", Name: _entMan.GetComponent<MetaDataComponent>(eventArgs.Using).EntityName)));
|
||||
eventArgs.User.PopupMessageCursor(Loc.GetString("seed-extractor-component-interact-message",("name", _entMan.GetComponent<MetaDataComponent>(eventArgs.Using).EntityName)));
|
||||
|
||||
_entMan.QueueDeleteEntity(eventArgs.Using);
|
||||
|
||||
|
||||
@@ -280,8 +280,7 @@ namespace Content.Server.Botany
|
||||
|
||||
public IEnumerable<EntityUid> AutoHarvest(EntityCoordinates position, int yieldMod = 1)
|
||||
{
|
||||
if (position.IsValid(IoCManager.Resolve<IEntityManager>()) && ProductPrototypes != null &&
|
||||
ProductPrototypes.Count > 0)
|
||||
if (position.IsValid(IoCManager.Resolve<IEntityManager>()) && ProductPrototypes.Count > 0)
|
||||
return GenerateProduct(position, yieldMod);
|
||||
|
||||
return Enumerable.Empty<EntityUid>();
|
||||
@@ -291,10 +290,10 @@ namespace Content.Server.Botany
|
||||
{
|
||||
AddToDatabase();
|
||||
|
||||
if (user == null)
|
||||
if (!user.Valid)
|
||||
return Enumerable.Empty<EntityUid>();
|
||||
|
||||
if (ProductPrototypes == null || ProductPrototypes.Count == 0 || Yield <= 0)
|
||||
if (ProductPrototypes.Count == 0 || Yield <= 0)
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("botany-harvest-fail-message"));
|
||||
return Enumerable.Empty<EntityUid>();
|
||||
@@ -312,14 +311,8 @@ namespace Content.Server.Botany
|
||||
if (yieldMod < 0)
|
||||
{
|
||||
yieldMod = 1;
|
||||
totalYield = Yield;
|
||||
}
|
||||
else
|
||||
{
|
||||
totalYield = Yield * yieldMod;
|
||||
}
|
||||
|
||||
totalYield = Math.Max(1, totalYield);
|
||||
totalYield = Math.Max(1, Yield * yieldMod);
|
||||
}
|
||||
|
||||
var random = IoCManager.Resolve<IRobustRandom>();
|
||||
|
||||
@@ -197,7 +197,7 @@ namespace Content.Server.Chat.Managers
|
||||
var msg = _netManager.CreateNetMessage<MsgChatMessage>();
|
||||
msg.Channel = ChatChannel.Local;
|
||||
msg.Message = message;
|
||||
msg.MessageWrap = Loc.GetString("chat-manager-entity-say-wrap-message",("entityName", Name: _entManager.GetComponent<MetaDataComponent>(source).EntityName));
|
||||
msg.MessageWrap = Loc.GetString("chat-manager-entity-say-wrap-message",("entityName", _entManager.GetComponent<MetaDataComponent>(source).EntityName));
|
||||
msg.SenderEntity = source;
|
||||
msg.HideChat = hideChat;
|
||||
_netManager.ServerSendToMany(msg, clients);
|
||||
@@ -234,7 +234,7 @@ namespace Content.Server.Chat.Managers
|
||||
var msg = _netManager.CreateNetMessage<MsgChatMessage>();
|
||||
msg.Channel = ChatChannel.Emotes;
|
||||
msg.Message = action;
|
||||
msg.MessageWrap = Loc.GetString("chat-manager-entity-me-wrap-message", ("entityName",Name: _entManager.GetComponent<MetaDataComponent>(source).EntityName));
|
||||
msg.MessageWrap = Loc.GetString("chat-manager-entity-me-wrap-message", ("entityName", _entManager.GetComponent<MetaDataComponent>(source).EntityName));
|
||||
msg.SenderEntity = source;
|
||||
_netManager.ServerSendToMany(msg, clients);
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace Content.Server.Climbing.Components
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target == null || !_entities.HasComponent<ClimbingComponent>(dragged))
|
||||
if (!_entities.HasComponent<ClimbingComponent>(dragged))
|
||||
{
|
||||
reason = Loc.GetString("comp-climbable-cant-climb");
|
||||
return false;
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Content.Server.Clothing
|
||||
|
||||
private void AddToggleVerb(EntityUid uid, MagbootsComponent component, GetActivationVerbsEvent args)
|
||||
{
|
||||
if (args.User == null || !args.CanAccess || !args.CanInteract)
|
||||
if (!args.User.Valid || !args.CanAccess || !args.CanInteract)
|
||||
return;
|
||||
|
||||
Verb verb = new();
|
||||
|
||||
@@ -37,10 +37,10 @@ namespace Content.Server.Construction.Conditions
|
||||
|
||||
if (airlock.BoltsDown != Value)
|
||||
{
|
||||
if (Value == true)
|
||||
args.PushMarkup(Loc.GetString("construction-examine-condition-airlock-bolt", ("entityName", Name: entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
|
||||
if (Value)
|
||||
args.PushMarkup(Loc.GetString("construction-examine-condition-airlock-bolt", ("entityName", entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
|
||||
else
|
||||
args.PushMarkup(Loc.GetString("construction-examine-condition-airlock-unbolt", ("entityName", Name: entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
|
||||
args.PushMarkup(Loc.GetString("construction-examine-condition-airlock-unbolt", ("entityName", entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,9 +36,9 @@ namespace Content.Server.Construction.Conditions
|
||||
if (door.IsWeldedShut != Welded)
|
||||
{
|
||||
if (Welded == true)
|
||||
args.PushMarkup(Loc.GetString("construction-examine-condition-door-weld", ("entityName", Name: entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
|
||||
args.PushMarkup(Loc.GetString("construction-examine-condition-door-weld", ("entityName", entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
|
||||
else
|
||||
args.PushMarkup(Loc.GetString("construction-examine-condition-door-unweld", ("entityName", Name: entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
|
||||
args.PushMarkup(Loc.GetString("construction-examine-condition-door-unweld", ("entityName", entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace Content.Server.Disposal.Unit.Components
|
||||
|
||||
private bool PlayerCanUse(EntityUid player)
|
||||
{
|
||||
if (player == null)
|
||||
if (!player.Valid)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ namespace Content.Server.Explosion.EntitySystems
|
||||
{
|
||||
[Dependency] private readonly ExplosionSystem _explosions = default!;
|
||||
[Dependency] private readonly FlashSystem _flashSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Content.Server.Ghost.Components
|
||||
msg.Channel = ChatChannel.Radio;
|
||||
msg.Message = message;
|
||||
//Square brackets are added here to avoid issues with escaping
|
||||
msg.MessageWrap = Loc.GetString("chat-radio-message-wrap", ("channel", $"\\[{channel}\\]"), ("name", Name: _entMan.GetComponent<MetaDataComponent>(speaker).EntityName));
|
||||
msg.MessageWrap = Loc.GetString("chat-radio-message-wrap", ("channel", $"\\[{channel}\\]"), ("name", _entMan.GetComponent<MetaDataComponent>(speaker).EntityName));
|
||||
_netManager.ServerSendMessage(msg, playerChannel);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,21 +99,21 @@ namespace Content.Server.Hands.Components
|
||||
var source = @event.Source;
|
||||
var target = @event.Target;
|
||||
|
||||
if (source != null)
|
||||
if (source.Valid)
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(source), _disarmedSound.GetSound(), source, AudioHelpers.WithVariation(0.025f));
|
||||
|
||||
if (target != null)
|
||||
if (target.Valid)
|
||||
{
|
||||
if (ActiveHand != null && Drop(ActiveHand, false))
|
||||
{
|
||||
source.PopupMessageOtherClients(Loc.GetString("hands-component-disarm-success-others-message", ("disarmer", Name: _entities.GetComponent<MetaDataComponent>(source).EntityName), ("disarmed", Name: _entities.GetComponent<MetaDataComponent>(target).EntityName)));
|
||||
source.PopupMessageCursor(Loc.GetString("hands-component-disarm-success-message", ("disarmed", Name: _entities.GetComponent<MetaDataComponent>(target).EntityName)));
|
||||
source.PopupMessageOtherClients(Loc.GetString("hands-component-disarm-success-others-message", ("disarmer", _entities.GetComponent<MetaDataComponent>(source).EntityName), ("disarmed", _entities.GetComponent<MetaDataComponent>(target).EntityName)));
|
||||
source.PopupMessageCursor(Loc.GetString("hands-component-disarm-success-message", ("disarmed", _entities.GetComponent<MetaDataComponent>(target).EntityName)));
|
||||
}
|
||||
else
|
||||
{
|
||||
source.PopupMessageOtherClients(Loc.GetString("hands-component-shove-success-others-message", ("shover", Name: _entities.GetComponent<MetaDataComponent>(source).EntityName), ("shoved", Name: _entities.GetComponent<MetaDataComponent>(target).EntityName)));
|
||||
source.PopupMessageCursor(Loc.GetString("hands-component-shove-success-message", ("shoved", Name: _entities.GetComponent<MetaDataComponent>(target).EntityName)));
|
||||
source.PopupMessageOtherClients(Loc.GetString("hands-component-shove-success-others-message", ("shover", _entities.GetComponent<MetaDataComponent>(source).EntityName), ("shoved", _entities.GetComponent<MetaDataComponent>(target).EntityName)));
|
||||
source.PopupMessageCursor(Loc.GetString("hands-component-shove-success-message", ("shoved", _entities.GetComponent<MetaDataComponent>(target).EntityName)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ namespace Content.Server.Hands.Systems
|
||||
[UsedImplicitly]
|
||||
internal sealed class HandsSystem : SharedHandsSystem
|
||||
{
|
||||
[Dependency] private readonly InteractionSystem _interactionSystem = default!;
|
||||
[Dependency] private readonly StackSystem _stackSystem = default!;
|
||||
[Dependency] private readonly HandVirtualItemSystem _virtualItemSystem = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Content.Server.Headset
|
||||
msg.Channel = ChatChannel.Radio;
|
||||
msg.Message = message;
|
||||
//Square brackets are added here to avoid issues with escaping
|
||||
msg.MessageWrap = Loc.GetString("chat-radio-message-wrap", ("channel", $"\\[{channel}\\]"), ("name", Name: _entMan.GetComponent<MetaDataComponent>(source).EntityName));
|
||||
msg.MessageWrap = Loc.GetString("chat-radio-message-wrap", ("channel", $"\\[{channel}\\]"), ("name", _entMan.GetComponent<MetaDataComponent>(source).EntityName));
|
||||
_netManager.ServerSendMessage(msg, playerChannel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ namespace Content.Server.Inventory.Components
|
||||
var canEquip = CanEquip(msg.Inventoryslot, activeHand, true, out var reason);
|
||||
_hoverEntity =
|
||||
new KeyValuePair<Slots, (EntityUid entity, bool fits)>(msg.Inventoryslot,
|
||||
(Uid: activeHand.Owner, canEquip));
|
||||
(activeHand.Owner, canEquip));
|
||||
|
||||
Dirty();
|
||||
}
|
||||
|
||||
@@ -67,17 +67,12 @@ namespace Content.Server.Light.EntitySystems
|
||||
// standard interaction checks
|
||||
if (!_blocker.CanInteract(eventArgs.User)) return;
|
||||
|
||||
if (eventArgs.Used != null)
|
||||
{
|
||||
var usedUid = eventArgs.Used;
|
||||
|
||||
// want to insert a new light bulb?
|
||||
if (EntityManager.TryGetComponent(usedUid, out LightBulbComponent ? bulb))
|
||||
eventArgs.Handled = TryInsertBulb(uid, usedUid, eventArgs.User, true, component, bulb);
|
||||
if (EntityManager.TryGetComponent(eventArgs.Used, out LightBulbComponent ? bulb))
|
||||
eventArgs.Handled = TryInsertBulb(uid, eventArgs.Used, eventArgs.User, true, component, bulb);
|
||||
// add bulbs from storage?
|
||||
else if (EntityManager.TryGetComponent(usedUid, out ServerStorageComponent? storage))
|
||||
eventArgs.Handled = TryInsertBulbsFromStorage(uid, usedUid, eventArgs.User, component, storage);
|
||||
}
|
||||
else if (EntityManager.TryGetComponent(eventArgs.Used, out ServerStorageComponent? storage))
|
||||
eventArgs.Handled = TryInsertBulbsFromStorage(uid, eventArgs.Used, eventArgs.User, component, storage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -108,7 +103,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
(e) => EntityManager.GetComponentOrNull<LightBulbComponent>(e)?.Type == fixture.BulbType);
|
||||
|
||||
// found bulb in inserted storage
|
||||
if (bulb != null)
|
||||
if (bulb.Valid)
|
||||
{
|
||||
// try to remove it
|
||||
var hasRemoved = replacer.InsertedBulbs.Remove(bulb);
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Content.Server.Lock
|
||||
args.PushText(Loc.GetString(lockComp.Locked
|
||||
? "lock-comp-on-examined-is-locked"
|
||||
: "lock-comp-on-examined-is-unlocked",
|
||||
("entityName", Name: EntityManager.GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
|
||||
("entityName", EntityManager.GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
|
||||
}
|
||||
|
||||
public bool TryLock(EntityUid uid, EntityUid user, LockComponent? lockComp = null)
|
||||
@@ -78,13 +78,10 @@ namespace Content.Server.Lock
|
||||
if (!HasUserAccess(uid, user, quiet: false))
|
||||
return false;
|
||||
|
||||
lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-lock-success", ("entityName",Name: EntityManager.GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
|
||||
lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-lock-success", ("entityName", EntityManager.GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
|
||||
lockComp.Locked = true;
|
||||
|
||||
if(lockComp.LockSound != null)
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(lockComp.Owner), lockComp.LockSound.GetSound(), lockComp.Owner, AudioParams.Default.WithVolume(-5));
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(lockComp.Owner, out AppearanceComponent? appearanceComp))
|
||||
{
|
||||
@@ -110,10 +107,7 @@ namespace Content.Server.Lock
|
||||
lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-unlock-success", ("entityName", Name: EntityManager.GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
|
||||
lockComp.Locked = false;
|
||||
|
||||
if(lockComp.UnlockSound != null)
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(lockComp.Owner), lockComp.UnlockSound.GetSound(), lockComp.Owner, AudioParams.Default.WithVolume(-5));
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(lockComp.Owner, out AppearanceComponent? appearanceComp))
|
||||
{
|
||||
|
||||
@@ -21,7 +21,6 @@ public class GameMapManager : IGameMapManager
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly IChatManager _chatManager = default!;
|
||||
[Dependency] private readonly IMapLoader _mapLoader = default!;
|
||||
|
||||
private GameMapPrototype _currentMap = default!;
|
||||
private bool _currentMapForced;
|
||||
|
||||
@@ -263,7 +263,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
if (!drink.Opened)
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-not-open",
|
||||
("owner", Name: EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
|
||||
("owner", EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
drinkSolution.DrainAvailable <= 0)
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty",
|
||||
("entity", Name: EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
|
||||
("entity", EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
if (!drink.Opened)
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-not-open",
|
||||
("owner", Name: EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
|
||||
("owner", EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
drinkSolution.DrainAvailable <= 0)
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty",
|
||||
("entity", Name: EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
|
||||
("entity", EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Server.Body.Systems;
|
||||
using Content.Server.Chemistry.EntitySystems;
|
||||
@@ -19,17 +18,13 @@ using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Helpers;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.MobState.Components;
|
||||
using Content.Shared.Tag;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Player;
|
||||
using System.Collections.Generic;
|
||||
using Robust.Shared.Utility;
|
||||
using Content.Server.Inventory.Components;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Hands;
|
||||
|
||||
namespace Content.Server.Nutrition.EntitySystems
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace Content.Server.PAI
|
||||
|
||||
private void AddWipeVerb(EntityUid uid, PAIComponent pai, GetActivationVerbsEvent args)
|
||||
{
|
||||
if (args.User == null || !args.CanAccess || !args.CanInteract)
|
||||
if (!args.User.Valid || !args.CanAccess || !args.CanInteract)
|
||||
return;
|
||||
|
||||
if (EntityManager.TryGetComponent<MindComponent>(uid, out var mind) && mind.HasMind)
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
var held = hand.HeldEntity;
|
||||
// Pulsing is hardcoded here because I don't think it needs to be more complex than that right now.
|
||||
// Update if I'm wrong.
|
||||
if ((held != null) && _toolSystem.HasQuality(held, "Pulsing"))
|
||||
if (held.Valid && _toolSystem.HasQuality(held, "Pulsing"))
|
||||
{
|
||||
args.PushMarkup(GenerateCableMarkup(uid));
|
||||
// args.PushFancyUpdatingPowerGraphs(uid);
|
||||
|
||||
@@ -134,13 +134,10 @@ namespace Content.Server.PowerCell.Components
|
||||
if (cell == null || !CanRemoveCell) return null;
|
||||
if (!_cellContainer.Remove(cell.Owner)) return null;
|
||||
//Dirty();
|
||||
if (user != null)
|
||||
{
|
||||
if (!_entities.TryGetComponent(user, out HandsComponent? hands) || !hands.PutInHand(_entities.GetComponent<ItemComponent>(cell.Owner)))
|
||||
{
|
||||
_entities.GetComponent<TransformComponent>(cell.Owner).Coordinates = _entities.GetComponent<TransformComponent>(user).Coordinates;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_entities.GetComponent<TransformComponent>(cell.Owner).Coordinates = _entities.GetComponent<TransformComponent>(Owner).Coordinates;
|
||||
|
||||
@@ -235,7 +235,7 @@ namespace Content.Server.RCD.Systems
|
||||
mode = (++mode) % _modes.Length; //Then, do a rollover on the value so it doesnt hit an invalid state
|
||||
rcd.Mode = (RcdMode) mode; //Finally, cast the newly acquired int mode to an RCDmode so we can use it.
|
||||
|
||||
if (user != null)
|
||||
if (user.Valid)
|
||||
{
|
||||
var msg = Loc.GetString("rcd-component-change-mode", ("mode", rcd.Mode.ToString()));
|
||||
rcd.Owner.PopupMessage(user, msg); //Prints an overhead message above the RCD
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
using System.Collections.Generic;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.Radio.Components
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Content.Server.Storage.Components
|
||||
|
||||
var lockerEnt = _robustRandom.Pick(lockers);
|
||||
|
||||
if (lockerEnt == null) return; // No valid lockers anywhere.
|
||||
if (!lockerEnt.Valid) return; // No valid lockers anywhere.
|
||||
|
||||
var locker = _entMan.GetComponent<EntityStorageComponent>(lockerEnt);
|
||||
|
||||
|
||||
@@ -40,16 +40,16 @@ namespace Content.Server.Stunnable
|
||||
var source = args.Source;
|
||||
var target = args.Target;
|
||||
|
||||
if (source != null)
|
||||
if (source.Valid)
|
||||
{
|
||||
var knock = EntityManager.GetComponent<KnockedDownComponent>(uid);
|
||||
SoundSystem.Play(Filter.Pvs(source), knock.StunAttemptSound.GetSound(), source, AudioHelpers.WithVariation(0.025f));
|
||||
|
||||
if (target != null)
|
||||
if (target.Valid)
|
||||
{
|
||||
// TODO: Use PopupSystem
|
||||
source.PopupMessageOtherClients(Loc.GetString("stunned-component-disarm-success-others", ("source", Name: EntityManager.GetComponent<MetaDataComponent>(source).EntityName), ("target", Name: EntityManager.GetComponent<MetaDataComponent>(target).EntityName)));
|
||||
source.PopupMessageCursor(Loc.GetString("stunned-component-disarm-success", ("target", Name: EntityManager.GetComponent<MetaDataComponent>(target).EntityName)));
|
||||
source.PopupMessageOtherClients(Loc.GetString("stunned-component-disarm-success-others", ("source", EntityManager.GetComponent<MetaDataComponent>(source).EntityName), ("target", EntityManager.GetComponent<MetaDataComponent>(target).EntityName)));
|
||||
source.PopupMessageCursor(Loc.GetString("stunned-component-disarm-success", ("target", EntityManager.GetComponent<MetaDataComponent>(target).EntityName)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace Content.Server.Suspicion
|
||||
continue;
|
||||
}
|
||||
|
||||
allies.Add((role.Role!.Mind.CharacterName, Uid: role.Owner));
|
||||
allies.Add((role.Role!.Mind.CharacterName, role.Owner));
|
||||
}
|
||||
|
||||
return new SuspicionRoleComponentState(Role?.Name, Role?.Antagonist, allies.ToArray());
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Content.Server.Toilet
|
||||
|
||||
private const float PryLidTime = 1f;
|
||||
|
||||
private bool _isPrying = false;
|
||||
private bool _isPrying;
|
||||
|
||||
[DataField("pryingQuality", customTypeSerializer:typeof(PrototypeIdSerializer<ToolQualityPrototype>))]
|
||||
private string _pryingQuality = "Prying";
|
||||
@@ -157,20 +157,20 @@ namespace Content.Server.Toilet
|
||||
if (_entMan.TryGetComponent<SharedBodyComponent?>(victim, out var body) &&
|
||||
body.HasPartOfType(BodyPartType.Head))
|
||||
{
|
||||
var othersMessage = Loc.GetString("toilet-component-suicide-head-message-others", ("victim",Name: _entMan.GetComponent<MetaDataComponent>(victim).EntityName),("owner", Name: _entMan.GetComponent<MetaDataComponent>(Owner).EntityName));
|
||||
var othersMessage = Loc.GetString("toilet-component-suicide-head-message-others", ("victim", _entMan.GetComponent<MetaDataComponent>(victim).EntityName),("owner", _entMan.GetComponent<MetaDataComponent>(Owner).EntityName));
|
||||
victim.PopupMessageOtherClients(othersMessage);
|
||||
|
||||
var selfMessage = Loc.GetString("toilet-component-suicide-head-message", ("owner", Name: _entMan.GetComponent<MetaDataComponent>(Owner).EntityName));
|
||||
var selfMessage = Loc.GetString("toilet-component-suicide-head-message", ("owner", _entMan.GetComponent<MetaDataComponent>(Owner).EntityName));
|
||||
victim.PopupMessage(selfMessage);
|
||||
|
||||
return SuicideKind.Asphyxiation;
|
||||
}
|
||||
else
|
||||
{
|
||||
var othersMessage = Loc.GetString("toilet-component-suicide-message-others",("victim", Name: _entMan.GetComponent<MetaDataComponent>(victim).EntityName),("owner", Name: _entMan.GetComponent<MetaDataComponent>(Owner).EntityName));
|
||||
var othersMessage = Loc.GetString("toilet-component-suicide-message-others",("victim", _entMan.GetComponent<MetaDataComponent>(victim).EntityName),("owner", _entMan.GetComponent<MetaDataComponent>(Owner).EntityName));
|
||||
victim.PopupMessageOtherClients(othersMessage);
|
||||
|
||||
var selfMessage = Loc.GetString("toilet-component-suicide-message", ("owner",Name: _entMan.GetComponent<MetaDataComponent>(Owner).EntityName));
|
||||
var selfMessage = Loc.GetString("toilet-component-suicide-message", ("owner", _entMan.GetComponent<MetaDataComponent>(Owner).EntityName));
|
||||
victim.PopupMessage(selfMessage);
|
||||
|
||||
return SuicideKind.Blunt;
|
||||
|
||||
@@ -270,7 +270,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
if (BoltOpen)
|
||||
{
|
||||
@@ -284,7 +284,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
return true;
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
return TryInsertBullet(eventArgs.User, eventArgs.Using);
|
||||
}
|
||||
|
||||
@@ -226,13 +226,13 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
Cycle(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
return TryInsertBullet(eventArgs);
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
/// <param name="eventArgs"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
EjectAllSlots();
|
||||
Dirty();
|
||||
@@ -260,7 +260,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
return true;
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
return TryInsertBullet(eventArgs.User, eventArgs.Using);
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
_appearanceComponent?.SetData(AmmoVisuals.AmmoMax, Capacity);
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
// Behavior:
|
||||
// If bolt open just close it
|
||||
@@ -305,7 +305,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
|
||||
_chamberContainer.Insert(nextRound);
|
||||
|
||||
if (_autoEjectMag && magazine != null && _entities.GetComponent<RangedMagazineComponent>(magazine).ShotsLeft == 0)
|
||||
if (_autoEjectMag && magazine.Valid && _entities.GetComponent<RangedMagazineComponent>(magazine).ShotsLeft == 0)
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(Owner), _soundAutoEject.GetSound(), Owner, AudioParams.Default.WithVolume(-2));
|
||||
|
||||
@@ -391,7 +391,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
UpdateAppearance();
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (CanInsertMagazine(eventArgs.User, eventArgs.Using, quiet: false))
|
||||
{
|
||||
|
||||
@@ -468,7 +468,7 @@ namespace Content.Shared.Body.Components
|
||||
var i = 0;
|
||||
foreach (var (part, slot) in SlotParts)
|
||||
{
|
||||
parts[i] = (slot.Id, Owner: part.Owner);
|
||||
parts[i] = (slot.Id, part.Owner);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,9 +111,6 @@ namespace Content.Shared.Hands.Components
|
||||
var hands = new List<HandVisualState>();
|
||||
foreach (var hand in Hands)
|
||||
{
|
||||
if (hand.HeldEntity == null)
|
||||
continue;
|
||||
|
||||
if (!entMan.TryGetComponent(hand.HeldEntity, out SharedItemComponent? item) || item.RsiPath == null)
|
||||
continue;
|
||||
|
||||
@@ -233,8 +230,8 @@ namespace Content.Shared.Hands.Components
|
||||
|
||||
public bool TryGetActiveHeldEntity(out EntityUid heldEntity)
|
||||
{
|
||||
heldEntity = GetActiveHand()?.HeldEntity ?? default;
|
||||
return heldEntity != null;
|
||||
heldEntity = GetActiveHand()?.HeldEntity ?? EntityUid.Invalid;
|
||||
return !heldEntity.Valid;
|
||||
}
|
||||
|
||||
public bool IsHolding(EntityUid entity)
|
||||
@@ -415,7 +412,7 @@ namespace Content.Shared.Hands.Components
|
||||
/// </summary>
|
||||
private bool CanRemoveHeldEntityFromHand(Hand hand)
|
||||
{
|
||||
if (hand.HeldEntity == null)
|
||||
if (!hand.HeldEntity.Valid)
|
||||
return false;
|
||||
|
||||
var heldEntity = hand.HeldEntity;
|
||||
@@ -446,7 +443,7 @@ namespace Content.Shared.Hands.Components
|
||||
/// </summary>
|
||||
private void RemoveHeldEntityFromHand(Hand hand)
|
||||
{
|
||||
if (hand.HeldEntity == null)
|
||||
if (!hand.HeldEntity.Valid)
|
||||
return;
|
||||
|
||||
var heldEntity = hand.HeldEntity;
|
||||
@@ -537,7 +534,7 @@ namespace Content.Shared.Hands.Components
|
||||
|
||||
private bool CanPutHeldEntityIntoContainer(Hand hand, IContainer targetContainer, bool checkActionBlocker)
|
||||
{
|
||||
if (hand.HeldEntity == null)
|
||||
if (!hand.HeldEntity.Valid)
|
||||
return false;
|
||||
|
||||
var heldEntity = hand.HeldEntity;
|
||||
@@ -556,7 +553,7 @@ namespace Content.Shared.Hands.Components
|
||||
/// </summary>
|
||||
private void PutHeldEntityIntoContainer(Hand hand, IContainer targetContainer)
|
||||
{
|
||||
if (hand.HeldEntity == null)
|
||||
if (!hand.HeldEntity.Valid)
|
||||
return;
|
||||
|
||||
var heldEntity = hand.HeldEntity;
|
||||
|
||||
@@ -650,7 +650,7 @@ namespace Content.Shared.Interaction
|
||||
/// <param name="used"></param>
|
||||
public void TryUseInteraction(EntityUid user, EntityUid used, bool altInteract = false)
|
||||
{
|
||||
if (user != null && used != null && _actionBlockerSystem.CanUse(user))
|
||||
if (user.Valid && used.Valid && _actionBlockerSystem.CanUse(user))
|
||||
{
|
||||
if (altInteract)
|
||||
AltInteract(user, used);
|
||||
@@ -820,7 +820,7 @@ namespace Content.Shared.Interaction
|
||||
/// </summary>
|
||||
public bool TryDroppedInteraction(EntityUid user, EntityUid item)
|
||||
{
|
||||
if (user == null || item == null || !_actionBlockerSystem.CanDrop(user)) return false;
|
||||
if (!user.Valid || !item.Valid || !_actionBlockerSystem.CanDrop(user)) return false;
|
||||
|
||||
DroppedInteraction(user, item);
|
||||
return true;
|
||||
|
||||
@@ -12,8 +12,6 @@ namespace Content.Shared.Standing
|
||||
{
|
||||
public sealed class StandingStateSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedHandsSystem _sharedHandsSystem = default!;
|
||||
|
||||
public bool IsDown(EntityUid uid, StandingStateComponent? standingState = null)
|
||||
{
|
||||
if (!Resolve(uid, ref standingState, false))
|
||||
|
||||
Reference in New Issue
Block a user