]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
Merge remote-tracking branch 'origin/terencehill/centerprint_stuff'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index 3bb6e6b7ca0d65d9472b1d905e67e870735a6b03..4192e4973118730e96099f20143a4a96d8b66aaa 100644 (file)
@@ -1673,8 +1673,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 != "")
@@ -2017,6 +2016,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())
@@ -2025,6 +2025,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;
@@ -2470,6 +2475,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;
@@ -2522,6 +2528,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;