]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
Write some actual content for common.qc and common.qh
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index 965c2743b590878c0e0e4c7bc8f2eef42e82c760..c76ddb38a55dd868bf6d9864e1847783395c5066 100644 (file)
@@ -8,6 +8,21 @@ void crosshair_trace(entity pl)
 {
        traceline_antilag(pl, pl.cursor_trace_start, pl.cursor_trace_start + normalize(pl.cursor_trace_endpos - pl.cursor_trace_start) * MAX_SHOT_DISTANCE, MOVE_NORMAL, pl, ANTILAG_LATENCY(pl));
 }
+void crosshair_trace_plusvisibletriggers(entity pl)
+{
+       entity first;
+       entity e;
+       first = findchainfloat(solid, SOLID_TRIGGER);
+
+       for (e = first; e; e = e.chain)
+               if (e.model != "")
+                       e.solid = SOLID_BSP;
+
+       crosshair_trace(pl);
+
+       for (e = first; e; e = e.chain)
+               e.solid = SOLID_TRIGGER;
+}
 void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag);
 void WarpZone_crosshair_trace(entity pl)
 {
@@ -1086,6 +1101,12 @@ void readlevelcvars(void)
                MUTATOR_ADD(mutator_rocketflying);
        if(cvar("g_vampire"))
                MUTATOR_ADD(mutator_vampire);
+       if(cvar("g_spawn_near_teammate"))
+               MUTATOR_ADD(mutator_spawn_near_teammate);
+
+       // is this a mutator? is this a mode?
+       if(cvar("g_sandbox"))
+               MUTATOR_ADD(sandbox);
 
        if(cvar("sv_allow_fullbright"))
                serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT;
@@ -2027,14 +2048,6 @@ void URI_Get_Callback(float id, float status, string data)
     }
 }
 
-void print_to(entity e, string s)
-{
-    if (e)
-        sprint(e, strcat(s, "\n"));
-    else
-        print(s, "\n");
-}
-
 string uid2name(string myuid) {
        string s;
        s = db_get(ServerProgsDB, strcat("/uid2name/", myuid));
@@ -3135,29 +3148,3 @@ float isPushable(entity e)
                return TRUE;
        return FALSE;
 }
-
-// used by gamecommand/clientcommand/votecommand/bancommand system
-float GetFilteredNumber(string input)
-{
-       entity tmp_player, selection;
-       float output, matches;
-       
-       // check and see if we can get a number from input like "#3" or "3" 
-       if(substring(input, 0, 1) == "#")
-               output = stof(substring(input, 1, -1));
-       else
-               output = stof(input);
-               
-       // if we can't, check and see if we can match the input to the netname of any player in the game
-       if not(output) 
-       {
-               FOR_EACH_CLIENT(tmp_player)
-                       if (strdecolorize(tmp_player.netname) == strdecolorize(input))
-                               selection = tmp_player;
-
-               if (selection) { output = num_for_edict(selection); }
-       }
-               
-       print(strcat("input: ", input, ", output: ", ftos(output), ",\n"));
-       return output;
-}