Ver Fonte

fix recoil, Alt-Z for cycling

Taislin há 8 meses atrás
pai
commit
9b3cdb1009

+ 3 - 3
Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs

@@ -26,7 +26,7 @@ protected virtual void InitializeBallistic()
         SubscribeLocalEvent<BallisticAmmoProviderComponent, GetAmmoCountEvent>(OnBallisticAmmoCount);
 
         SubscribeLocalEvent<BallisticAmmoProviderComponent, ExaminedEvent>(OnBallisticExamine);
-        SubscribeLocalEvent<BallisticAmmoProviderComponent, GetVerbsEvent<Verb>>(OnBallisticVerb);
+        SubscribeLocalEvent<BallisticAmmoProviderComponent, GetVerbsEvent<AlternativeVerb>>(OnBallisticVerb);
         SubscribeLocalEvent<BallisticAmmoProviderComponent, InteractUsingEvent>(OnBallisticInteractUsing);
         SubscribeLocalEvent<BallisticAmmoProviderComponent, AfterInteractEvent>(OnBallisticAfterInteract);
         SubscribeLocalEvent<BallisticAmmoProviderComponent, AmmoFillDoAfterEvent>(OnBallisticAmmoFillDoAfter);
@@ -160,14 +160,14 @@ void SimulateInsertAmmo(EntityUid ammo, EntityUid ammoProvider, EntityCoordinate
         args.Repeat = moreSpace && moreAmmo;
     }
 
-    private void OnBallisticVerb(EntityUid uid, BallisticAmmoProviderComponent component, GetVerbsEvent<Verb> args)
+    private void OnBallisticVerb(EntityUid uid, BallisticAmmoProviderComponent component, GetVerbsEvent<AlternativeVerb> args)
     {
         if (!args.CanAccess || !args.CanInteract || args.Hands == null || !component.Cycleable)
             return;
 
         if (component.Cycleable)
         {
-            args.Verbs.Add(new Verb()
+            args.Verbs.Add(new AlternativeVerb()
             {
                 Text = Loc.GetString("gun-ballistic-cycle"),
                 Disabled = GetBallisticShots(component) == 0,

+ 1 - 1
Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs

@@ -494,6 +494,7 @@ void MarkPredicted(EntityUid projectile, int index)
                             MuzzleFlash(gunUid, cartridge, mapDirection.ToAngle(), user);
                             Audio.PlayPredicted(gun.SoundGunshotModified, gunUid, user);
                         }
+                        Recoil(user, mapDirection, gun.CameraRecoilScalarModified);
                     }
                     else
                     {
@@ -501,7 +502,6 @@ void MarkPredicted(EntityUid projectile, int index)
                         Audio.PlayPredicted(gun.SoundEmpty, gunUid, user);
                     }
 
-                    Recoil(user, mapDirection, gun.CameraRecoilScalarModified);
 
                     // Something like ballistic might want to leave it in the container still
                     if (!cartridge.DeleteOnSpawn && !Containers.IsEntityInContainer(ent!.Value))