From b464510ca14c05ac9b45c992d71812b7f9e4ae10 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 15 Jan 2020 02:01:47 +1000 Subject: [PATCH] Fix raptor cannon spamming attacks as fast as it can instead of obeying its refire, also increase the refire to match the current ticrate --- qcsrc/common/vehicles/vehicle/raptor_weapons.qc | 4 ++-- qcsrc/common/vehicles/vehicle/raptor_weapons.qh | 2 +- vehicles.cfg | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qcsrc/common/vehicles/vehicle/raptor_weapons.qc b/qcsrc/common/vehicles/vehicle/raptor_weapons.qc index 1b9e9063b..27ec4ce0e 100644 --- a/qcsrc/common/vehicles/vehicle/raptor_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/raptor_weapons.qc @@ -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; diff --git a/qcsrc/common/vehicles/vehicle/raptor_weapons.qh b/qcsrc/common/vehicles/vehicle/raptor_weapons.qh index 37b87bbad..c762acfa2 100644 --- a/qcsrc/common/vehicles/vehicle/raptor_weapons.qh +++ b/qcsrc/common/vehicles/vehicle/raptor_weapons.qh @@ -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; diff --git a/vehicles.cfg b/vehicles.cfg index d3a2c0bc5..7aa6e888f 100644 --- a/vehicles.cfg +++ b/vehicles.cfg @@ -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 -- 2.39.2