From: Freddy Date: Tue, 26 Jul 2016 22:00:07 +0000 (+0200) Subject: fix ammo charge display and charge cancel for shotgun X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fheads%2FDefaultUser%2Fweapon_experiments;p=xonotic%2Fxonotic-data.pk3dir.git fix ammo charge display and charge cancel for shotgun --- 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 } }