From: Mario Date: Sat, 11 Jun 2016 17:19:56 +0000 (+1000) Subject: Fix a crash with nades X-Git-Tag: xonotic-v0.8.2~820 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=011697b6da16f1d95db88065ab99f38d5828cfd8;p=xonotic%2Fxonotic-data.pk3dir.git Fix a crash with nades --- diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index d643d8790..8faebab0b 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -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;