From 647e7e70043eeefa69b4eb9f6982d2aaff42412a Mon Sep 17 00:00:00 2001 From: Freddy Date: Wed, 27 Jul 2016 00:00:07 +0200 Subject: [PATCH] fix ammo charge display and charge cancel for shotgun --- bal-wep-xonotic.cfg | 1 + qcsrc/common/weapons/weapon/shotgun.qc | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg index 2aa7037ee..5bef587c7 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -57,6 +57,7 @@ set g_balance_shotgun_numcircles 2 set g_balance_shotgun_reload_ammo 0 set g_balance_shotgun_reload_time 2 set g_balance_shotgun_secondary 1 +set g_balance_shotgun_secondary_ammo 1 set g_balance_shotgun_secondary_bullets 4 set g_balance_shotgun_secondary_animtime 1.15 set g_balance_shotgun_secondary_damage 70 diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc index ba58d993e..624c26d4f 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -461,7 +461,7 @@ METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentit } else { - if(fire & 1) + if(fire & 1 && !actor.shotgun_load && !actor.shotgun_loadblock) { if(time >= actor.shotgun_primarytime) // handle refire separately so the secondary can be fired straight after a primary { @@ -520,6 +520,12 @@ METHOD(Shotgun, wr_checkammo2, bool(entity thiswep, entity actor)) ammo_amount += actor.(weapon_load[WEP_SHOTGUN.m_id]) >= WEP_CVAR_PRI(shotgun, ammo); return ammo_amount; } + case 3: + { + float ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR_SEC(shotgun, ammo); + ammo_amount += actor.(weapon_load[WEP_SHOTGUN.m_id]) >= WEP_CVAR_SEC(shotgun, ammo); + return ammo_amount; + } default: return false; // secondary unavailable } } -- 2.39.2