]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
mutator_invincibleproj.qc: Add a mutator (like g_rocketflying) which allows projectil...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index 7a0257a068b33058814025f3419787e2e7d0c8fb..d79cfa4fc4627fa523d0e946c9756444aea3ab69 100644 (file)
@@ -616,6 +616,7 @@ void GetCvars(float f)
        GetCvars_handleFloatOnce(s, f, cvar_cl_gunalign, "cl_gunalign");
        GetCvars_handleFloat(s, f, cvar_cl_allow_uid2name, "cl_allow_uid2name");
        GetCvars_handleFloat(s, f, cvar_cl_allow_uidtracking, "cl_allow_uidtracking");
+       GetCvars_handleFloat(s, f, cvar_cl_movement_track_canjump, "cl_movement_track_canjump");
 
        // fixup of switchweapon (needed for LMS or when spectating is disabled, as PutClientInServer comes too early)
        if (f > 0)
@@ -1120,6 +1121,8 @@ string GetGametype(); // g_world.qc
 void readlevelcvars(void)
 {
        // first load all the mutators
+       if(cvar("g_invincible_projectiles"))
+               MUTATOR_ADD(mutator_invincibleprojectiles);
        if(cvar("g_nix"))
                MUTATOR_ADD(mutator_nix);
        if(cvar("g_dodging"))
@@ -1179,7 +1182,6 @@ void readlevelcvars(void)
        g_bloodloss = cvar("g_bloodloss");
        sv_maxidle = cvar("sv_maxidle");
        sv_maxidle_spectatorsareidle = cvar("sv_maxidle_spectatorsareidle");
-       sv_pogostick = cvar("sv_pogostick");
        g_ctf_reverse = cvar("g_ctf_reverse");
        sv_autotaunt = cvar("sv_autotaunt");
        sv_taunt = cvar("sv_taunt");
@@ -1256,9 +1258,6 @@ void readlevelcvars(void)
     if(!g_weapon_stay)
         g_weapon_stay = cvar("g_weapon_stay");
 
-       if (!g_weapon_stay && (cvar("deathmatch") == 2))
-               g_weapon_stay = 1;
-
        g_ghost_items = cvar("g_ghost_items");
 
        if(g_ghost_items >= 1)
@@ -1673,8 +1672,7 @@ void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration,
                msg_entity = e;
                WRITESPECTATABLE_MSG_ONE({
                        WriteByte(MSG_ONE, SVC_TEMPENTITY);
-                       WriteByte(MSG_ONE, TE_CSQC_NOTIFY);
-                       WriteByte(MSG_ONE, CSQC_CENTERPRINT_GENERIC);
+                       WriteByte(MSG_ONE, TE_CSQC_CENTERPRINT_GENERIC);
                        WriteByte(MSG_ONE, id);
                        WriteString(MSG_ONE, s);
                        if (id != 0 && s != "")
@@ -1754,6 +1752,8 @@ void remove_except_protected(entity e)
 
 void remove_unsafely(entity e)
 {
+    if(e.classname == "spike")
+        error("Removing spikes is forbidden (crylink bug), please report");
     remove_builtin(e);
 }
 
@@ -2015,6 +2015,7 @@ float SUB_NoImpactCheck()
 #define SUB_OwnerCheck() (other && (other == self.owner))
 
 void RemoveGrapplingHook(entity pl);
+void W_Crylink_Dequeue(entity e);
 float WarpZone_Projectile_Touch_ImpactFilter_Callback()
 {
        if(SUB_OwnerCheck())
@@ -2023,6 +2024,11 @@ float WarpZone_Projectile_Touch_ImpactFilter_Callback()
        {
                if(self.classname == "grapplinghook")
                        RemoveGrapplingHook(self.realowner);
+               else if(self.classname == "spike")
+               {
+                       W_Crylink_Dequeue(self);
+                       remove(self);
+               }
                else
                        remove(self);
                return TRUE;
@@ -2468,6 +2474,7 @@ float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, f
 {
     float m, i;
     vector start, org, delta, end, enddown, mstart;
+    entity sp;
 
     m = e.dphitcontentsmask;
     e.dphitcontentsmask = goodcontents | badcontents;
@@ -2520,6 +2527,19 @@ float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, f
         if (trace_fraction >= 1)
             continue;
 
+       // rule 4: we must "see" some spawnpoint
+       for(sp = world; (sp = find(sp, classname, "info_player_deathmatch")); )
+               if(checkpvs(mstart, sp))
+                       break;
+       if(!sp)
+       {
+               for(sp = world; (sp = findflags(sp, flags, FL_ITEM)); )
+                       if(checkpvs(mstart, sp))
+                               break;
+               if(!sp)
+                       continue;
+       }
+
         // find a random vector to "look at"
         end_x = org_x + random() * delta_x;
         end_y = org_y + random() * delta_y;