]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make primary fire work in vehicles if the player has no gun
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sat, 10 Jun 2023 17:44:50 +0000 (17:44 +0000)
committerLegendaryGuard <rootuser999@gmail.com>
Sat, 10 Jun 2023 17:44:50 +0000 (17:44 +0000)
qcsrc/server/weapons/weaponsystem.qc

index df6490128aa993ac84239930a0a477336d078fc0..20e713c2a7db4c6b287f5f63792f02ed054d9310 100644 (file)
@@ -291,7 +291,7 @@ bool weapon_prepareattack_check(Weapon thiswep, entity actor, .entity weaponenti
                if (ATTACK_FINISHED(actor, weaponentity) > time + actor.(weaponentity).weapon_frametime * 0.5) return false;
                entity this = actor.(weaponentity);
                // don't fire while changing weapon
-               if (this.state != WS_READY) return false;
+               if (!actor.vehicle && this.state != WS_READY) return false;
        }
        return true;
 }