]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
Merge remote branch 'origin/master' into tzork/gm_nexball
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index d8b5ccb3b2357c7ea176a0ba4c42c4f271916e3c..a0cf9c06479975229edaa7299cf0191f6929f3be 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)
 {
@@ -781,10 +796,6 @@ float want_weapon(string cvarprefix, entity weaponinfo, float allguns)
                        t |= (i == WEP_HOOK);
        }
 
-       // we cannot disable porto in Nexball, we must force it
-       if(g_nexball && i == WEP_PORTO)
-               t = 1;
-
        return t;
 }
 
@@ -990,20 +1001,6 @@ void readplayerstartcvars()
        if (g_jetpack)
                start_items |= IT_JETPACK;
 
-       if (g_weapon_stay == 2)
-       {
-               if (!start_ammo_shells) start_ammo_shells = g_pickup_shells;
-               if (!start_ammo_nails) start_ammo_nails = g_pickup_nails;
-               if (!start_ammo_cells) start_ammo_cells = g_pickup_cells;
-               if (!start_ammo_rockets) start_ammo_rockets = g_pickup_rockets;
-               if (!start_ammo_fuel) start_ammo_fuel = g_pickup_fuel;
-               if (!warmup_start_ammo_shells) warmup_start_ammo_shells = g_pickup_shells;
-               if (!warmup_start_ammo_nails) warmup_start_ammo_nails = g_pickup_nails;
-               if (!warmup_start_ammo_cells) warmup_start_ammo_cells = g_pickup_cells;
-               if (!warmup_start_ammo_rockets) warmup_start_ammo_rockets = g_pickup_rockets;
-               if (!warmup_start_ammo_fuel) warmup_start_ammo_fuel = g_pickup_fuel;
-       }
-
        MUTATOR_CALLHOOK(SetStartItems);
 
        for (i = WEP_FIRST; i <= WEP_LAST; ++i)
@@ -1069,6 +1066,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;
@@ -1244,12 +1247,12 @@ float sound_allowed(float dest, entity e)
 }
 
 #ifdef COMPAT_XON010_CHANNELS
-void(entity e, float chan, string samp, float vol, float atten) sound_builtin = #8;
+void(entity e, float chan, string samp, float vol, float atten) builtin_sound = #8;
 void sound(entity e, float chan, string samp, float vol, float atten)
 {
     if (!sound_allowed(MSG_BROADCAST, e))
         return;
-    sound_builtin(e, chan, samp, vol, atten);
+    builtin_sound(e, chan, samp, vol, atten);
 }
 #else
 #undef sound
@@ -1671,7 +1674,7 @@ void make_safe_for_remove(entity e)
 void objerror(string s)
 {
     make_safe_for_remove(self);
-    objerror_builtin(s);
+    builtin_objerror(s);
 }
 
 .float remove_except_protected_forbidden;
@@ -1679,20 +1682,20 @@ void remove_except_protected(entity e)
 {
        if(e.remove_except_protected_forbidden)
                error("not allowed to remove this at this point");
-       remove_builtin(e);
+       builtin_remove(e);
 }
 
 void remove_unsafely(entity e)
 {
     if(e.classname == "spike")
         error("Removing spikes is forbidden (crylink bug), please report");
-    remove_builtin(e);
+    builtin_remove(e);
 }
 
 void remove_safely(entity e)
 {
     make_safe_for_remove(e);
-    remove_builtin(e);
+    builtin_remove(e);
 }
 
 void InitializeEntity(entity e, void(void) func, float order)
@@ -1753,7 +1756,7 @@ void InitializeEntitiesRun()
         {
             entity e_old;
             e_old = self.enemy;
-            remove_builtin(self);
+            builtin_remove(self);
             self = e_old;
         }
         //dprint("Delayed initialization: ", self.classname, "\n");
@@ -1850,7 +1853,7 @@ void adaptor_think2use_hittype_splash() // for timed projectile detonation
 // deferred dropping
 void DropToFloor_Handler()
 {
-    droptofloor_builtin();
+    builtin_droptofloor();
     self.dropped_origin = self.origin;
 }
 
@@ -3010,14 +3013,14 @@ float ExponentialFalloff(float mindist, float maxdist, float halflifedist, float
 
 
 #ifdef RELEASE
-#define cvar_string_normal cvar_string_builtin
-#define cvar_normal cvar_builtin
+#define cvar_string_normal builtin_cvar_string
+#define cvar_normal builtin_cvar
 #else
 string cvar_string_normal(string n)
 {
        if not(cvar_type(n) & 1)
                backtrace(strcat("Attempt to access undefined cvar: ", n));
-       return cvar_string_builtin(n);
+       return builtin_cvar_string(n);
 }
 
 float cvar_normal(string n)
@@ -3025,7 +3028,7 @@ float cvar_normal(string n)
        return stof(cvar_string_normal(n));
 }
 #endif
-#define cvar_set_normal cvar_set_builtin
+#define cvar_set_normal builtin_cvar_set
 
 void defer_think()
 {