+#ifdef GAMEQC
+entity findbox_tofield_Fallback(vector mins, vector maxs, .entity tofield)
+{
+ // 0.03125 minimum radius because findradius returns no results if radius is zero
+ // but findbox for a zero-sized box returns entities touching the specified point
+ entity chain = findradius_tofield(0.5 * (mins + maxs), max(0.03125, 0.5 * vlen(maxs - mins)), tofield);
+ entity prev = NULL;
+ for (entity e = chain; e; e = e.tofield)
+ {
+ if (boxesoverlap(e.absmin, e.absmax, mins, maxs))
+ prev = e;
+ else // not in box so remove from chain
+ {
+ if (prev)
+ prev.tofield = e.tofield;
+ else
+ chain = chain.tofield;
+ }
+ }
+ return chain;
+}
+entity findbox_Fallback(vector mins, vector maxs)
+{
+ return findbox_tofield_Fallback(mins, maxs, chain);
+}
+#endif // GAMEQC
+