]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
Merge branch 'master' into Mario/turrets
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index 6eb281ba78ddc0a0e6cfbdfa67303fccaa66bc58..0eb71b93c2682df9d0b4182c8b1430246627e9bd 100644 (file)
@@ -650,16 +650,16 @@ float want_weapon(string cvarprefix, entity weaponinfo, float allguns)
                d = 0; // weapon is set a few lines later
        else
                d = (i == WEP_LASER || i == WEP_SHOTGUN);
-               
+
        if(g_grappling_hook) // if possible, redirect off-hand hook to on-hand hook
                d |= (i == WEP_HOOK);
        if(weaponinfo.spawnflags & WEP_FLAG_MUTATORBLOCKED) // never default mutator blocked guns
                d = 0;
 
        var float t = cvar(strcat(cvarprefix, weaponinfo.netname));
-       
+
        //print(strcat("want_weapon: ", weaponinfo.netname, " - d: ", ftos(d), ", t: ", ftos(t), ". \n"));
-       
+
        // bit order in t:
        // 1: want or not
        // 2: is default?
@@ -791,7 +791,7 @@ void readplayerstartcvars()
 
        if(!cvar("g_use_ammunition"))
                start_items |= IT_UNLIMITED_AMMO;
-       
+
        if(start_items & IT_UNLIMITED_WEAPON_AMMO)
        {
                start_ammo_rockets = 999;
@@ -909,9 +909,9 @@ void readlevelcvars(void)
        // load mutators
        #define CHECK_MUTATOR_ADD(mut_cvar,mut_name,dependence) \
                { 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);
@@ -930,9 +930,9 @@ 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);
-       
+
        #undef CHECK_MUTATOR_ADD
-       
+
        if(cvar("sv_allow_fullbright"))
                serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT;
 
@@ -951,7 +951,7 @@ void readlevelcvars(void)
     g_bugrigs_speed_ref = cvar("g_bugrigs_speed_ref");
     g_bugrigs_speed_pow = cvar("g_bugrigs_speed_pow");
     g_bugrigs_steer = cvar("g_bugrigs_steer");
-       
+
        g_minstagib = cvar("g_minstagib");
 
        sv_clones = cvar("sv_clones");
@@ -972,7 +972,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");
@@ -1304,11 +1304,6 @@ void precache()
     // gamemode related things
     precache_model ("models/misc/chatbubble.spr");
 
-#ifdef TTURRETS_ENABLED
-    if (autocvar_g_turrets)
-        turrets_precash();
-#endif
-
     // Precache all player models if desired
     if (autocvar_sv_precacheplayermodels)
     {
@@ -1724,7 +1719,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)
@@ -1820,7 +1815,7 @@ string uid2name(string myuid) {
                        db_put(ServerProgsDB, strcat("uid2name", myuid), "");
                }
        }
-       
+
        if(s == "")
                s = "^1Unregistered Player";
        return s;
@@ -2013,65 +2008,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)));