]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a crash with nades
authorMario <mario@smbclan.net>
Sat, 11 Jun 2016 17:19:56 +0000 (03:19 +1000)
committerMario <mario@smbclan.net>
Sat, 11 Jun 2016 17:19:56 +0000 (03:19 +1000)
qcsrc/common/mutators/mutator/nades/nades.qc

index d643d8790c1cedfc074272cfcb239ab9dfaa2e42..8faebab0b07955b84908d506503ed8b9543bbd96 100644 (file)
@@ -958,9 +958,12 @@ void spawn_held_nade(entity player, entity nowner, float ntime, int ntype, strin
 {
        entity n = new(nade), fn = new(fake_nade);
 
-       n.nade_type = bound(1, ntype, Nades_COUNT);
+       n.nade_type = max(1, ntype);
        n.pokenade_type = pntype;
 
+       if(Nades_from(n.nade_type) == NADE_TYPE_Null)
+               n.nade_type = NADE_TYPE_NORMAL.m_id;
+
        setmodel(n, MDL_PROJECTILE_NADE);
        //setattachment(n, player, "bip01 l hand");
        n.exteriormodeltoclient = player;