From ada4c6f6a05729d8515333b0148052ae134f2738 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Mon, 3 Oct 2022 16:35:22 +1000 Subject: [PATCH] Reduce indent level in Item_FindTeam() --- qcsrc/server/items/items.qc | 50 ++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/qcsrc/server/items/items.qc b/qcsrc/server/items/items.qc index 99c0165fd..63bff8b46 100644 --- a/qcsrc/server/items/items.qc +++ b/qcsrc/server/items/items.qc @@ -750,37 +750,37 @@ void Item_FindTeam(entity this) { entity e; - if(this.effects & EF_NODRAW) + if(!(this.effects & EF_NODRAW)) + return; + + // marker for item team search + LOG_TRACE("Initializing item team ", ftos(this.team)); + RandomSelection_Init(); + IL_EACH(g_items, it.team == this.team, { - // marker for item team search - LOG_TRACE("Initializing item team ", ftos(this.team)); - RandomSelection_Init(); - IL_EACH(g_items, it.team == this.team, - { - if(it.itemdef) // is a registered item - RandomSelection_AddEnt(it, it.cnt, 0); - }); + if(it.itemdef) // is a registered item + RandomSelection_AddEnt(it, it.cnt, 0); + }); - e = RandomSelection_chosen_ent; - if (!e) - return; + e = RandomSelection_chosen_ent; + if (!e) + return; - IL_EACH(g_items, it.team == this.team, + IL_EACH(g_items, it.team == this.team, + { + if(it.itemdef) // is a registered item { - if(it.itemdef) // is a registered item + if(it != e) { - if(it != e) - { - // make it non-spawned - Item_Show(it, -1); - it.state = 1; // state 1 = initially hidden item, apparently - } - else - Item_Reset(it); - it.effects &= ~EF_NODRAW; + // make it non-spawned + Item_Show(it, -1); + it.state = 1; // state 1 = initially hidden item, apparently } - }); - } + else + Item_Reset(it); + it.effects &= ~EF_NODRAW; + } + }); } // Savage: used for item garbage-collection -- 2.39.2