]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
Merge branch 'Mario/spawnsystem_mutator' into Mario/overkill
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index 50fd92fad093c25c77759adc0ad29edc789fd273..77459d3dfb54f1bfbec0c73398350f58f635b719 100644 (file)
@@ -905,7 +905,7 @@ void readlevelcvars(void)
                { if(cvar(mut_cvar) && dependence) { MUTATOR_ADD(mut_name); } }
                
        CHECK_MUTATOR_ADD("g_dodging", mutator_dodging, 1);
-       CHECK_MUTATOR_ADD("g_spawn_near_teammate", mutator_spawn_near_teammate, 1);
+       CHECK_MUTATOR_ADD("g_spawn_near_teammate", mutator_spawn_near_teammate, teamplay);
        CHECK_MUTATOR_ADD("g_physical_items", mutator_physical_items, 1);
        CHECK_MUTATOR_ADD("g_touchexplode", mutator_touchexplode, 1);
        CHECK_MUTATOR_ADD("g_minstagib", mutator_minstagib, 1);
@@ -924,6 +924,7 @@ void readlevelcvars(void)
        CHECK_MUTATOR_ADD("g_nades", mutator_nades, 1);
        CHECK_MUTATOR_ADD("g_sandbox", sandbox, 1);
        CHECK_MUTATOR_ADD("g_campcheck", mutator_campcheck, 1);
+       CHECK_MUTATOR_ADD("g_overkill", mutator_overkill, !cvar("g_minstagib"));
        
        #undef CHECK_MUTATOR_ADD
        
@@ -1940,30 +1941,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;
        }