From: bones_was_here Date: Mon, 3 Oct 2022 06:35:22 +0000 (+1000) Subject: Reduce indent level in Item_FindTeam() X-Git-Tag: xonotic-v0.8.6~340^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ada4c6f6a05729d8515333b0148052ae134f2738;p=xonotic%2Fxonotic-data.pk3dir.git Reduce indent level in Item_FindTeam() --- 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