]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
Properly support team field on trigger_multiple
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index ef69905bdcfbdcbc561ad7e782acb06923b2574e..8b4204b126dfa1d1b44306a0abc51222391bc837 100644 (file)
@@ -1244,6 +1244,7 @@ float MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundma
     });
        if(!sp)
        {
+               int items_checked = 0;
                IL_EACH(g_items, checkpvs(mstart, it),
                {
                        if((traceline(mstart, it.origin + (it.mins + it.maxs) * 0.5, MOVE_NORMAL, e), trace_fraction) >= 1)
@@ -1251,6 +1252,10 @@ float MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundma
                                sp = it;
                                break;
                        }
+
+                       ++items_checked;
+                       if(items_checked >= attempts)
+                               break; // sanity
                });
 
                if(!sp)