Merge remote-tracking branch 'upstream/master' into ed-22-05-2024-upstream
This commit is contained in:
@@ -315,7 +315,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
|
||||
public bool AttemptLightAttack(EntityUid user, EntityUid weaponUid, MeleeWeaponComponent weapon, EntityUid target)
|
||||
{
|
||||
if (!TryComp<TransformComponent>(target, out var targetXform))
|
||||
if (!TryComp(target, out TransformComponent? targetXform))
|
||||
return false;
|
||||
|
||||
return AttemptAttack(user, weaponUid, weapon, new LightAttackEvent(GetNetEntity(target), GetNetEntity(weaponUid), GetNetCoordinates(targetXform.Coordinates)), null);
|
||||
@@ -323,7 +323,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
|
||||
public bool AttemptDisarmAttack(EntityUid user, EntityUid weaponUid, MeleeWeaponComponent weapon, EntityUid target)
|
||||
{
|
||||
if (!TryComp<TransformComponent>(target, out var targetXform))
|
||||
if (!TryComp(target, out TransformComponent? targetXform))
|
||||
return false;
|
||||
|
||||
return AttemptAttack(user, weaponUid, weapon, new DisarmAttackEvent(GetNetEntity(target), GetNetCoordinates(targetXform.Coordinates)), null);
|
||||
@@ -451,7 +451,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
// For consistency with wide attacks stuff needs damageable.
|
||||
if (Deleted(target) ||
|
||||
!HasComp<DamageableComponent>(target) ||
|
||||
!TryComp<TransformComponent>(target, out var targetXform) ||
|
||||
!TryComp(target, out TransformComponent? targetXform) ||
|
||||
// Not in LOS.
|
||||
!InRange(user, target.Value, component.Range, session))
|
||||
{
|
||||
@@ -539,7 +539,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
private bool DoHeavyAttack(EntityUid user, HeavyAttackEvent ev, EntityUid meleeUid, MeleeWeaponComponent component, ICommonSession? session)
|
||||
{
|
||||
// TODO: This is copy-paste as fuck with DoPreciseAttack
|
||||
if (!TryComp<TransformComponent>(user, out var userXform))
|
||||
if (!TryComp(user, out TransformComponent? userXform))
|
||||
return false;
|
||||
|
||||
var targetMap = GetCoordinates(ev.Coordinates).ToMap(EntityManager, TransformSystem);
|
||||
@@ -753,7 +753,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
private void DoLungeAnimation(EntityUid user, EntityUid weapon, Angle angle, MapCoordinates coordinates, float length, string? animation)
|
||||
{
|
||||
// TODO: Assert that offset eyes are still okay.
|
||||
if (!TryComp<TransformComponent>(user, out var userXform))
|
||||
if (!TryComp(user, out TransformComponent? userXform))
|
||||
return;
|
||||
|
||||
var invMatrix = TransformSystem.GetInvWorldMatrix(userXform);
|
||||
|
||||
Reference in New Issue
Block a user