diff --git a/Content.Client/_RMC14/Weapons/Ranged/Prediction/GunPredictionSystem.cs b/Content.Client/_RMC14/Weapons/Ranged/Prediction/GunPredictionSystem.cs index 884074b5c7..9f700146a0 100644 --- a/Content.Client/_RMC14/Weapons/Ranged/Prediction/GunPredictionSystem.cs +++ b/Content.Client/_RMC14/Weapons/Ranged/Prediction/GunPredictionSystem.cs @@ -7,8 +7,6 @@ using Robust.Client.GameObjects; using Robust.Client.Physics; using Robust.Client.Player; -using Robust.Shared; -using Robust.Shared.Configuration; using Robust.Shared.Map; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Events; @@ -19,7 +17,6 @@ namespace Content.Client._RMC14.Weapons.Ranged.Prediction; public sealed class GunPredictionSystem : SharedGunPredictionSystem { - [Dependency] private readonly IConfigurationManager _config = default!; [Dependency] private readonly SharedGunSystem _gun = default!; [Dependency] private readonly PhysicsSystem _physics = default!; [Dependency] private readonly IPlayerManager _player = default!; @@ -27,14 +24,19 @@ public sealed class GunPredictionSystem : SharedGunPredictionSystem [Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; + private EntityQuery _ignorePredictionHideQuery; + private EntityQuery _spriteQuery; + public override void Initialize() { base.Initialize(); + _ignorePredictionHideQuery = GetEntityQuery(); + _spriteQuery = GetEntityQuery(); + SubscribeLocalEvent(OnBeforeSolve); SubscribeLocalEvent(OnAfterSolve); SubscribeLocalEvent(OnShootRequest); - SubscribeNetworkEvent(OnLinearVelocityMsg); SubscribeLocalEvent(OnClientProjectileUpdateIsPredicted); SubscribeLocalEvent(OnClientProjectileStartCollide); @@ -76,11 +78,6 @@ private void OnShootRequest(RequestShootEvent ev, EntitySessionEventArgs args) _gun.ShootRequested(ev.Gun, ev.Coordinates, ev.Target, null, args.SenderSession); } - private void OnLinearVelocityMsg(MaxLinearVelocityMsg ev) - { - _config.SetCVar(CVars.MaxLinVelocity, ev.Velocity); - } - private void OnClientProjectileUpdateIsPredicted(Entity ent, ref UpdateIsPredictedEvent args) { args.IsPredicted = true; @@ -111,7 +108,13 @@ private void OnServerProjectileStartup(Entity(OnRoundRestartCleanup); SubscribeNetworkEvent(OnShootRequest); SubscribeNetworkEvent(OnPredictedProjectileHit); - SubscribeLocalEvent(OnSendLinearVelocityAll); SubscribeLocalEvent(OnPredictedMapInit); SubscribeLocalEvent(OnPredictedRemove); SubscribeLocalEvent(OnPredictedRemove); SubscribeLocalEvent(OnPredictedPreventCollide); - Subs.CVar(_config, CVars.MaxLinVelocity, OnSendLinearVelocityAll); Subs.CVar(_config, RMCCVars.RMCGunPredictionPreventCollision, v => _preventCollision = v, true); Subs.CVar(_config, RMCCVars.RMCGunPredictionLogHits, v => _logHits = v, true); Subs.CVar(_config, RMCCVars.RMCGunPredictionCoordinateDeviation, v => _coordinateDeviation = v, true); Subs.CVar(_config, RMCCVars.RMCGunPredictionLowestCoordinateDeviation, v => _lowestCoordinateDeviation = v, true); Subs.CVar(_config, RMCCVars.RMCGunPredictionAabbEnlargement, v => _aabbEnlargement = v, true); - _player.PlayerStatusChanged += OnPlayerStatusChanged; - } - - public override void Shutdown() - { - base.Shutdown(); - _player.PlayerStatusChanged -= OnPlayerStatusChanged; } private void OnRoundRestartCleanup(RoundRestartCleanupEvent ev) { _predicted.Clear(); - OnSendLinearVelocityAll(ev); } private void OnShootRequest(RequestShootEvent ev, EntitySessionEventArgs args) @@ -124,16 +103,6 @@ private void OnPredictedProjectileHit(PredictedProjectileHitEvent ev, EntitySess _predictedHits.Add((ev, args.SenderSession)); } - private void OnSendLinearVelocityAll(T ev) - { - if (_net.IsClient) - return; - - // TODO gun prediction remove this when we pull engine with a replicated physics maxlinvelocity - var msg = new MaxLinearVelocityMsg(_config.GetCVar(CVars.MaxLinVelocity)); - RaiseNetworkEvent(msg); - } - private void OnPredictedPreventCollide(Entity ent, ref PreventCollideEvent args) { if (!_preventCollision) @@ -162,16 +131,6 @@ private void OnPredictedPreventCollide(Entity projectile, Entity other, diff --git a/Content.Shared/_RMC14/Weapons/Ranged/Prediction/MaxLinearVelocityMsg.cs b/Content.Shared/_RMC14/Weapons/Ranged/Prediction/MaxLinearVelocityMsg.cs deleted file mode 100644 index 087270abfd..0000000000 --- a/Content.Shared/_RMC14/Weapons/Ranged/Prediction/MaxLinearVelocityMsg.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Robust.Shared.Serialization; - -namespace Content.Shared._RMC14.Weapons.Ranged.Prediction; - -[Serializable, NetSerializable] -public sealed class MaxLinearVelocityMsg(float velocity) : EntityEventArgs -{ - public float Velocity = velocity; -}