]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix ammo charge display and charge cancel for shotgun DefaultUser/weapon_experiments
authorFreddy <schro.sb@gmail.com>
Tue, 26 Jul 2016 22:00:07 +0000 (00:00 +0200)
committerFreddy <schro.sb@gmail.com>
Tue, 26 Jul 2016 22:00:07 +0000 (00:00 +0200)
bal-wep-xonotic.cfg
qcsrc/common/weapons/weapon/shotgun.qc

index 2aa7037ee522deaf4bf42a2f9239c5984f009163..5bef587c79774796e393e9730538fabbc0701775 100644 (file)
@@ -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
index ba58d993eee61f140302c4055dffb967a9dedc28..624c26d4fa8fe9974696c71337fb7d35f2eec736 100644 (file)
@@ -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
     }
 }