]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix vehicles able to attack before the round begins
authorMario <mario@smbclan.net>
Wed, 8 May 2019 13:52:05 +0000 (23:52 +1000)
committerMario <mario@smbclan.net>
Wed, 8 May 2019 13:52:05 +0000 (23:52 +1000)
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/vehicles/vehicle/spiderbot.qc
qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc

index 2bd81f12d2c7a0165f06b892251d4b29ab879de1..7c0e61cd6e662329db5d4eea736d8a2b347ebe56 100644 (file)
@@ -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;
index eb9d6623a698848a507037c4bcb43aeadc5eee16..e2a2593948130a5d3e896dd3e779fd4c3345ecd7 100644 (file)
@@ -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))
        {
index 6e91441685d49cde764aec948312a38365aa172e..e9f7f7333d17bc495a2f202983ce5378abeaf28f 100644 (file)
@@ -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)
index 36f6cb2f8b81f712de78d70d0ad8aa4e27eba7dc..68b422fad820bac87b4aaf2d276bf64458e82534 100644 (file)
@@ -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;
index 4b48eeccead4f0c082452d988dc8ab9f79586704..3b4b60eef0a6b3b875e020f778d9653281cf2b62 100644 (file)
@@ -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"));