]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Increase requirements for screenshots: doesn't reach caulk by an axial
authorRudolf Polzer <divverent@xonotic.org>
Fri, 13 Sep 2013 10:23:38 +0000 (12:23 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 13 Sep 2013 10:23:38 +0000 (12:23 +0200)
direction, and must see an item/spawnpoint.

qcsrc/server/miscfunctions.qc

index 50fd92fad093c25c77759adc0ad29edc789fd273..0b5b42781229f0df535621e4b373a0e36302329a 100644 (file)
@@ -1940,30 +1940,32 @@ float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, f
         // these can be traceLINES as we already verified the starting box
         mstart = start + 0.5 * (e.mins + e.maxs);
         traceline(mstart, mstart + '1 0 0' * delta_x, MOVE_NORMAL, e);
-        if (trace_fraction >= 1)
+        if (trace_fraction >= 1 || trace_dphittexturename == "common/caulk")
             continue;
         traceline(mstart, mstart - '1 0 0' * delta_x, MOVE_NORMAL, e);
-        if (trace_fraction >= 1)
+        if (trace_fraction >= 1 || trace_dphittexturename == "common/caulk")
             continue;
         traceline(mstart, mstart + '0 1 0' * delta_y, MOVE_NORMAL, e);
-        if (trace_fraction >= 1)
+        if (trace_fraction >= 1 || trace_dphittexturename == "common/caulk")
             continue;
         traceline(mstart, mstart - '0 1 0' * delta_y, MOVE_NORMAL, e);
-        if (trace_fraction >= 1)
+        if (trace_fraction >= 1 || trace_dphittexturename == "common/caulk")
             continue;
         traceline(mstart, mstart + '0 0 1' * delta_z, MOVE_NORMAL, e);
-        if (trace_fraction >= 1)
+        if (trace_fraction >= 1 || trace_dphittexturename == "common/caulk")
             continue;
 
-       // rule 4: we must "see" some spawnpoint
+       // rule 4: we must "see" some spawnpoint or item
        for(sp = world; (sp = find(sp, classname, "info_player_deathmatch")); )
                if(checkpvs(mstart, sp))
-                       break;
+                       if((traceline(mstart, sp.origin, MOVE_NORMAL, e), trace_fraction) >= 1)
+                               break;
        if(!sp)
        {
                for(sp = world; (sp = findflags(sp, flags, FL_ITEM)); )
                        if(checkpvs(mstart, sp))
-                               break;
+                               if((traceline(mstart, sp.origin + (sp.mins + sp.maxs) * 0.5, MOVE_NORMAL, e), trace_fraction) >= 1)
+                                       break;
                if(!sp)
                        continue;
        }