From: terencehill Date: Wed, 28 Aug 2019 22:17:52 +0000 (+0200) Subject: Fix #2279 "Randomised powerups not working correctly" X-Git-Tag: xonotic-v0.8.5~1357 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=59fd396c7eb8a934f34ec985d3b78c73c4817ef7;p=xonotic%2Fxonotic-data.pk3dir.git Fix #2279 "Randomised powerups not working correctly" --- diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 3ea391865..a5786888c 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -1008,8 +1008,8 @@ void Item_FindTeam(entity this) }); e = RandomSelection_chosen_ent; - e.state = 0; - Item_Show(e, 1); + if (!e) + return; IL_EACH(g_items, it.team == this.team, { @@ -1021,11 +1021,11 @@ void Item_FindTeam(entity this) Item_Show(it, -1); it.state = 1; // state 1 = initially hidden item, apparently } + else + Item_Reset(it); it.effects &= ~EF_NODRAW; } }); - - Item_Reset(this); } } @@ -1360,7 +1360,7 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default } this.state = 0; - if(this.team) // broken, no idea why. + if(this.team) { if(!this.cnt) this.cnt = 1; // item probability weight