]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix raptor cannon spamming attacks as fast as it can instead of obeying its refire...
authorMario <mario.mario@y7mail.com>
Tue, 14 Jan 2020 16:01:47 +0000 (02:01 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 14 Jan 2020 16:02:07 +0000 (02:02 +1000)
qcsrc/common/vehicles/vehicle/raptor_weapons.qc
qcsrc/common/vehicles/vehicle/raptor_weapons.qh
vehicles.cfg

index 1b9e9063bdb88452688303dbbe71b0d1f105a7c2..27ec4ce0ea705ae260af44cf0ba8dc929973f9fd 100644 (file)
@@ -7,7 +7,7 @@ METHOD(RaptorCannon, wr_think, void(entity thiswep, entity actor, .entity weapon
     entity player = isPlayer ? actor : actor.owner;
     entity veh = player.vehicle;
     // 1 [wait] 1 [wait] 2 [wait] 2 [wait] [wait]
-    float t = autocvar_g_vehicle_raptor_cannon_refire * (1 + veh.misc_bulletcounter == 4);
+    float t = autocvar_g_vehicle_raptor_cannon_refire * (1 + ((veh.misc_bulletcounter + 1) >= 4));
     if (fire & 1)
     if (weapon_prepareattack(thiswep, player, weaponentity, false, t)) {
         if (isPlayer) W_SetupShot_Dir(player, weaponentity, v_forward, false, 0, SND_Null, CH_WEAPON_B, 0, DEATH_VH_RAPT_CANNON.m_id);
@@ -16,7 +16,7 @@ METHOD(RaptorCannon, wr_think, void(entity thiswep, entity actor, .entity weapon
         if (veh) {
             veh.misc_bulletcounter += 1;
             org = (veh.misc_bulletcounter <= 2) ? gettaginfo(veh.gun1, gettagindex(veh.gun1, "fire1"))
-              : (((veh.misc_bulletcounter == 4) ? veh.misc_bulletcounter = 0 : 0), gettaginfo(veh.gun2, gettagindex(veh.gun2, "fire1")));
+              : (((veh.misc_bulletcounter >= 4) ? veh.misc_bulletcounter = 0 : 0), gettaginfo(veh.gun2, gettagindex(veh.gun2, "fire1")));
             dir = v_forward;
             veh.vehicle_energy -= autocvar_g_vehicle_raptor_cannon_cost;
             actor.cnt = time;
index 37b87bbada36ff97a675eed836914a9b650a7c58..c762acfa2309386816c7445dbd79e75a53b3565d 100644 (file)
@@ -30,7 +30,7 @@ REGISTER_WEAPON(RAPTOR_FLARE, NEW(RaptorFlare));
 float autocvar_g_vehicle_raptor_cannon_cost = 1;
 float autocvar_g_vehicle_raptor_cannon_damage = 10;
 float autocvar_g_vehicle_raptor_cannon_radius = 60;
-float autocvar_g_vehicle_raptor_cannon_refire = 0.03;
+float autocvar_g_vehicle_raptor_cannon_refire = 0.033333;
 float autocvar_g_vehicle_raptor_cannon_speed = 24000;
 float autocvar_g_vehicle_raptor_cannon_spread = 0.01;
 float autocvar_g_vehicle_raptor_cannon_force = 25;
index d3a2c0bc5658e578f14f4236f97530ddfd5f18cb..7aa6e888f9f0fb4007421595b3fc96ea1b7d7b76 100644 (file)
@@ -226,7 +226,7 @@ set g_vehicle_raptor_bouncepain "1 4 1000"
 set g_vehicle_raptor_cannon_cost 1
 set g_vehicle_raptor_cannon_damage 10
 set g_vehicle_raptor_cannon_radius 60
-set g_vehicle_raptor_cannon_refire 0.03
+set g_vehicle_raptor_cannon_refire 0.033333
 set g_vehicle_raptor_cannon_speed 24000
 set g_vehicle_raptor_cannon_spread 0.01
 set g_vehicle_raptor_cannon_force 25