From 31635c22befd73ea13aa80bc02291ce0dbb92dae Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 8 May 2019 23:52:05 +1000 Subject: [PATCH] Fix vehicles able to attack before the round begins --- qcsrc/common/vehicles/vehicle/bumblebee.qc | 4 ++-- qcsrc/common/vehicles/vehicle/racer.qc | 2 +- qcsrc/common/vehicles/vehicle/raptor.qc | 4 ++-- qcsrc/common/vehicles/vehicle/spiderbot.qc | 2 +- qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qc b/qcsrc/common/vehicles/vehicle/bumblebee.qc index 2bd81f12d..7c0e61cd6 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qc @@ -157,7 +157,7 @@ bool bumblebee_gunner_frame(entity this, float dt) autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down * -1, autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up, _out * -1, _in, autocvar_g_vehicle_bumblebee_cannon_turnspeed, dt); - if(!weaponLocked(this)) + if(!weaponLocked(this) && !weaponUseForbidden(this)) if(PHYS_INPUT_BUTTON_ATCK(this)) if(time > gun.attack_finished_single[0]) if(gun.vehicle_energy >= autocvar_g_vehicle_bumblebee_cannon_cost) @@ -531,7 +531,7 @@ bool bumblebee_pilot_frame(entity this, float dt) autocvar_g_vehicle_bumblebee_raygun_pitchlimit_down * -1, autocvar_g_vehicle_bumblebee_raygun_pitchlimit_up, autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides * -1, autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides, autocvar_g_vehicle_bumblebee_raygun_turnspeed, dt); - if(!weaponLocked(this)) + if(!weaponLocked(this) && !weaponUseForbidden(this)) if((PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_ATCK2(this)) && (vehic.vehicle_energy > autocvar_g_vehicle_bumblebee_raygun_dps * PHYS_INPUT_FRAMETIME || autocvar_g_vehicle_bumblebee_raygun == 0)) { vehic.gun3.enemy.realowner = this; diff --git a/qcsrc/common/vehicles/vehicle/racer.qc b/qcsrc/common/vehicles/vehicle/racer.qc index eb9d6623a..e2a259394 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qc +++ b/qcsrc/common/vehicles/vehicle/racer.qc @@ -287,7 +287,7 @@ bool racer_frame(entity this, float dt) Weapon wep1 = WEP_RACER; .entity weaponentity = weaponentities[0]; // TODO: unhardcode - if (!weaponLocked(player)) + if (!weaponLocked(player) && !weaponUseForbidden(player)) if (PHYS_INPUT_BUTTON_ATCK(player)) if (wep1.wr_checkammo1(wep1, vehic, weaponentity)) { diff --git a/qcsrc/common/vehicles/vehicle/raptor.qc b/qcsrc/common/vehicles/vehicle/raptor.qc index 6e9144168..e9f7f7333 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qc +++ b/qcsrc/common/vehicles/vehicle/raptor.qc @@ -358,7 +358,7 @@ bool raptor_frame(entity this, float dt) Weapon wep1 = WEP_RAPTOR; .entity weaponentity = weaponentities[0]; - if(!weaponLocked(this)) + if(!weaponLocked(this) && !weaponUseForbidden(this)) if(PHYS_INPUT_BUTTON_ATCK(this)) if (wep1.wr_checkammo1(wep1, vehic, weaponentity)) { @@ -375,7 +375,7 @@ bool raptor_frame(entity this, float dt) vehicles_regen(vehic, vehic.cnt, vehicle_energy, autocvar_g_vehicle_raptor_energy, autocvar_g_vehicle_raptor_energy_regen_pause, autocvar_g_vehicle_raptor_energy_regen, dt, false); Weapon wep2a = WEP_RAPTOR_BOMB; - if(!weaponLocked(this)) + if(!weaponLocked(this) && !weaponUseForbidden(this)) if(STAT(VEHICLESTAT_W2MODE, vehic) == RSM_BOMB) { if(time > vehic.lip + autocvar_g_vehicle_raptor_bombs_refire) diff --git a/qcsrc/common/vehicles/vehicle/spiderbot.qc b/qcsrc/common/vehicles/vehicle/spiderbot.qc index 36f6cb2f8..68b422fad 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot.qc @@ -246,7 +246,7 @@ bool spiderbot_frame(entity this, float dt) vehic.angles_x = bound(-autocvar_g_vehicle_spiderbot_tiltlimit, vehic.angles_x, autocvar_g_vehicle_spiderbot_tiltlimit); vehic.angles_z = bound(-autocvar_g_vehicle_spiderbot_tiltlimit, vehic.angles_z, autocvar_g_vehicle_spiderbot_tiltlimit); - if(!weaponLocked(this)) + if(!weaponLocked(this) && !weaponUseForbidden(this)) if(PHYS_INPUT_BUTTON_ATCK(this)) { vehic.cnt = time; diff --git a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc index 4b48eecce..3b4b60eef 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc @@ -175,7 +175,7 @@ void spiderbot_rocket_do(entity this) if(!PHYS_INPUT_BUTTON_ATCK2(this.owner)) return; - if(weaponLocked(this.owner)) + if(!weaponLocked(this.owner) && !weaponUseForbidden(this.owner)) return; v = gettaginfo(this.tur_head,gettagindex(this.tur_head,"tag_fire")); -- 2.39.2