]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/items/items.qc
Reduce indent level in Item_FindTeam()
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / items / items.qc
index 99c0165fd3a1b51061979bf4ff3fb384ab3bcdd2..63bff8b46b398ac5f4c8c036cc2d47b13a16295b 100644 (file)
@@ -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