Disable warnings that would be refactored anyway (#5047)
This commit is contained in:
@@ -18,7 +18,9 @@ using Robust.Shared.Utility;
|
||||
namespace Content.Server.Weapon.Ranged.Ammunition.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
#pragma warning disable 618
|
||||
public sealed class AmmoBoxComponent : Component, IInteractUsing, IUse, IInteractHand, IMapInit, IExamine
|
||||
#pragma warning restore 618
|
||||
{
|
||||
public override string Name => "AmmoBox";
|
||||
|
||||
|
||||
@@ -21,7 +21,9 @@ namespace Content.Server.Weapon.Ranged.Ammunition.Components
|
||||
/// Generally used for bullets but can be used for other things like bananas
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
#pragma warning disable 618
|
||||
public class AmmoComponent : Component, IExamine, ISerializationHooks
|
||||
#pragma warning restore 618
|
||||
{
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Server.Weapon.Ranged.Barrels.Components;
|
||||
@@ -17,9 +18,12 @@ namespace Content.Server.Weapon.Ranged.Ammunition.Components
|
||||
[DataField("solution")]
|
||||
public string SolutionName { get; set; } = DefaultSolutionName;
|
||||
|
||||
[Obsolete("Component Messages are deprecated, use Entity Events instead.")]
|
||||
public override void HandleMessage(ComponentMessage message, IComponent? component)
|
||||
{
|
||||
#pragma warning disable 618
|
||||
base.HandleMessage(message, component);
|
||||
#pragma warning restore 618
|
||||
switch (message)
|
||||
{
|
||||
case BarrelFiredMessage barrelFired:
|
||||
|
||||
@@ -18,7 +18,9 @@ using Robust.Shared.Utility;
|
||||
namespace Content.Server.Weapon.Ranged.Ammunition.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
#pragma warning disable 618
|
||||
public class RangedMagazineComponent : Component, IMapInit, IInteractUsing, IUse, IExamine
|
||||
#pragma warning restore 618
|
||||
{
|
||||
public override string Name => "RangedMagazine";
|
||||
|
||||
|
||||
@@ -26,7 +26,9 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[NetworkedComponent()]
|
||||
#pragma warning disable 618
|
||||
public sealed class BoltActionBarrelComponent : ServerRangedBarrelComponent, IMapInit, IExamine
|
||||
#pragma warning restore 618
|
||||
{
|
||||
// Originally I had this logic shared with PumpBarrel and used a couple of variables to control things
|
||||
// but it felt a lot messier to play around with, especially when adding verbs
|
||||
|
||||
@@ -27,7 +27,9 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
[NetworkedComponent()]
|
||||
#pragma warning disable 618
|
||||
public sealed class ServerMagazineBarrelComponent : ServerRangedBarrelComponent, IExamine
|
||||
#pragma warning restore 618
|
||||
{
|
||||
public override string Name => "MagazineBarrel";
|
||||
|
||||
@@ -311,7 +313,9 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
SoundSystem.Play(Filter.Pvs(Owner), _soundAutoEject.GetSound(), Owner, AudioParams.Default.WithVolume(-2));
|
||||
|
||||
MagazineContainer.Remove(magazine);
|
||||
#pragma warning disable 618
|
||||
SendNetworkMessage(new MagazineAutoEjectMessage());
|
||||
#pragma warning restore 618
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,9 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
/// All of the ranged weapon components inherit from this to share mechanics like shooting etc.
|
||||
/// Only difference between them is how they retrieve a projectile to shoot (battery, magazine, etc.)
|
||||
/// </summary>
|
||||
#pragma warning disable 618
|
||||
public abstract class ServerRangedBarrelComponent : SharedRangedBarrelComponent, IUse, IInteractUsing, IExamine, ISerializationHooks
|
||||
#pragma warning restore 618
|
||||
{
|
||||
// There's still some of py01 and PJB's work left over, especially in underlying shooting logic,
|
||||
// it's just when I re-organised it changed me as the contributor
|
||||
@@ -359,7 +361,9 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
|
||||
projectile.Transform.LocalRotation = projectileAngle + MathHelper.PiOver2;
|
||||
}
|
||||
#pragma warning disable 618
|
||||
ammo.SendMessage(this, new BarrelFiredMessage(firedProjectiles));
|
||||
#pragma warning restore 618
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -415,7 +419,9 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
}
|
||||
}
|
||||
|
||||
#pragma warning disable 618
|
||||
public class BarrelFiredMessage : ComponentMessage
|
||||
#pragma warning restore 618
|
||||
{
|
||||
public readonly List<IEntity> FiredProjectiles;
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ namespace Content.Server.Weapon.Ranged
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[Obsolete("Component Messages are deprecated, use Entity Events instead.")]
|
||||
public override void HandleNetworkMessage(ComponentMessage message, INetChannel channel, ICommonSession? session = null)
|
||||
{
|
||||
base.HandleNetworkMessage(message, channel, session);
|
||||
|
||||
Reference in New Issue
Block a user