]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
Merge branch 'master' into Mario/buffs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index 947a6b92aba7b31bc9926fc056b0f9a6c302c88d..5defa9b1e73bea7503cbed2351f2059e0ad242d4 100644 (file)
@@ -99,6 +99,8 @@ const string STR_OBSERVER = "observer";
 #define FOR_EACH_SPEC(v) FOR_EACH_CLIENT(v) if (!IS_PLAYER(v)) // Samual: shouldn't this be IS_SPEC(v)? and rather create a separate macro to include observers too
 #define FOR_EACH_REALPLAYER(v) FOR_EACH_REALCLIENT(v) if(IS_PLAYER(v))
 
+#define FOR_EACH_MONSTER(v) for(v = world; (v = findflags(v, flags, FL_MONSTER)) != world; )
+
 #define CENTER_OR_VIEWOFS(ent) (ent.origin + (IS_PLAYER(ent) ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5)))
 
 // copies a string to a tempstring (so one can strunzone it)
@@ -909,7 +911,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);
@@ -928,6 +930,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_buffs", mutator_buffs, 1);
 
        #undef CHECK_MUTATOR_ADD
 
@@ -970,7 +973,7 @@ void readlevelcvars(void)
        g_warmup_allguns = cvar("g_warmup_allguns");
        g_warmup_allow_timeout = cvar("g_warmup_allow_timeout");
 
-       if ((g_race && g_race_qualifying == 2) || g_arena || g_assault || cvar("g_campaign"))
+       if ((g_race && g_race_qualifying == 2) || g_assault || cvar("g_campaign"))
                warmup_stage = 0; // these modes cannot work together, sorry
 
        g_pickup_respawntime_weapon = cvar("g_pickup_respawntime_weapon");
@@ -1080,15 +1083,6 @@ float sound_allowed(float dest, entity e)
     return TRUE;
 }
 
-#ifdef COMPAT_XON010_CHANNELS
-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;
-    builtin_sound(e, chan, samp, vol, atten);
-}
-#else
 #undef sound
 void sound(entity e, float chan, string samp, float vol, float atten)
 {
@@ -1096,7 +1090,6 @@ void sound(entity e, float chan, string samp, float vol, float atten)
         return;
     sound7(e, chan, samp, vol, atten, 0, 0);
 }
-#endif
 
 void soundtoat(float dest, entity e, vector o, float chan, string samp, float vol, float atten)
 {
@@ -1722,7 +1715,7 @@ float SUB_NoImpactCheck()
        if(trace_dphitcontents == 0)
        {
                //dprint("A hit happened with zero hit contents... DEBUG THIS, this should never happen for projectiles! Projectile will self-destruct.\n");
-               dprint(sprintf("A hit from a projectile happened with no hit contents! DEBUG THIS, this should never happen for projectiles! Profectile will self-destruct. (edict: %d, classname: %s, origin: %s)\n", num_for_edict(self), self.classname, vtos(self.origin)));
+               dprintf("A hit from a projectile happened with no hit contents! DEBUG THIS, this should never happen for projectiles! Profectile will self-destruct. (edict: %d, classname: %s, origin: %s)\n", num_for_edict(self), self.classname, vtos(self.origin));
                checkclient();
        }
     if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
@@ -2011,65 +2004,6 @@ float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, f
         return FALSE;
 }
 
-float zcurveparticles_effectno;
-vector zcurveparticles_start;
-float zcurveparticles_spd;
-
-void endzcurveparticles()
-{
-       if(zcurveparticles_effectno)
-       {
-               // terminator
-               WriteShort(MSG_BROADCAST, zcurveparticles_spd | 0x8000);
-       }
-       zcurveparticles_effectno = 0;
-}
-
-void zcurveparticles(float effectno, vector start, vector end, float end_dz, float spd)
-{
-       spd = bound(0, floor(spd / 16), 32767);
-       if(effectno != zcurveparticles_effectno || start != zcurveparticles_start)
-       {
-               endzcurveparticles();
-               WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
-               WriteByte(MSG_BROADCAST, TE_CSQC_ZCURVEPARTICLES);
-               WriteShort(MSG_BROADCAST, effectno);
-               WriteCoord(MSG_BROADCAST, start_x);
-               WriteCoord(MSG_BROADCAST, start_y);
-               WriteCoord(MSG_BROADCAST, start_z);
-               zcurveparticles_effectno = effectno;
-               zcurveparticles_start = start;
-       }
-       else
-               WriteShort(MSG_BROADCAST, zcurveparticles_spd);
-       WriteCoord(MSG_BROADCAST, end_x);
-       WriteCoord(MSG_BROADCAST, end_y);
-       WriteCoord(MSG_BROADCAST, end_z);
-       WriteCoord(MSG_BROADCAST, end_dz);
-       zcurveparticles_spd = spd;
-}
-
-void zcurveparticles_from_tracetoss(float effectno, vector start, vector end, vector vel)
-{
-       float end_dz;
-       vector vecxy, velxy;
-
-       vecxy = end - start;
-       vecxy_z = 0;
-       velxy = vel;
-       velxy_z = 0;
-
-       if (vlen(velxy) < 0.000001 * fabs(vel_z))
-       {
-               endzcurveparticles();
-               trailparticles(world, effectno, start, end);
-               return;
-       }
-
-       end_dz = vlen(vecxy) / vlen(velxy) * vel_z - (end_z - start_z);
-       zcurveparticles(effectno, start, end, end_dz, vlen(vel));
-}
-
 void write_recordmarker(entity pl, float tstart, float dt)
 {
     GameLogEcho(strcat(":recordset:", ftos(pl.playerid), ":", ftos(dt)));