]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_impulse.qc
Merge branch 'master' into terencehill/slider_anim_improvements
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_impulse.qc
index 61c8d49aa65228be6fc78b82cb1ab80a9a7958e1..0271f085bd0a68b96304ee1571893959465fcec3 100644 (file)
@@ -11,6 +11,8 @@
 #include "weapons/tracing.qh"
 #include "weapons/weaponsystem.qh"
 
+#include "../common/minigames/sv_minigames.qh"
+
 #include "../common/weapons/all.qh"
 
 /*
@@ -49,7 +51,7 @@
  */
 
 void ImpulseCommands (void)
-{
+{SELFPARAM();
        int imp;
        vector org;
        float i;
@@ -61,6 +63,10 @@ void ImpulseCommands (void)
                return;
        self.impulse = 0;
 
+       if ( self.active_minigame )
+       if ( MinigameImpulse(imp) )
+               return;
+
        // allow only weapon change impulses when not in round time
        if(round_handler_IsActive() && !round_handler_IsRoundStarted())
        if(imp == 17 || (imp >= 20 && imp < 200) || imp > 253)
@@ -305,7 +311,7 @@ void ImpulseCommands (void)
                                        {
                                                if(e.wpcost >= 10000000)
                                                {
-                                                       print("unreachable: ", etos(e), " ", vtos(e.origin), "\n");
+                                                       LOG_INFO("unreachable: ", etos(e), " ", vtos(e.origin), "\n");
                                                        e.colormod_z = 8;
                                                        e.effects |= EF_NODEPTHTEST | EF_BLUE;
                                                        ++i;
@@ -313,14 +319,14 @@ void ImpulseCommands (void)
                                                }
                                        }
                                        if(i)
-                                               print(ftos(i), " waypoints cannot be reached from here in any way (marked with blue light)\n");
+                                               LOG_INFO(ftos(i), " waypoints cannot be reached from here in any way (marked with blue light)\n");
                                        navigation_markroutes_inverted(e2);
                                        i = 0;
                                        for(e = findchain(classname, "waypoint"); e; e = e.chain)
                                        {
                                                if(e.wpcost >= 10000000)
                                                {
-                                                       print("cannot reach me: ", etos(e), " ", vtos(e.origin), "\n");
+                                                       LOG_INFO("cannot reach me: ", etos(e), " ", vtos(e.origin), "\n");
                                                        e.colormod_x = 8;
                                                        if(!(e.effects & EF_NODEPTHTEST)) // not already reported before
                                                                ++m;
@@ -329,9 +335,9 @@ void ImpulseCommands (void)
                                                }
                                        }
                                        if(i)
-                                               print(ftos(i), " waypoints cannot walk to here in any way (marked with red light)\n");
+                                               LOG_INFO(ftos(i), " waypoints cannot walk to here in any way (marked with red light)\n");
                                        if(m)
-                                               print(ftos(m), " waypoints have been marked total\n");
+                                               LOG_INFO(ftos(m), " waypoints have been marked total\n");
                                        i = 0;
                                        for(e = findchain(classname, "info_player_deathmatch"); e; e = e.chain)
                                        {
@@ -347,7 +353,7 @@ void ImpulseCommands (void)
                                                else
                                                {
                                                        setorigin(e, org);
-                                                       print("spawn without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
+                                                       LOG_INFO("spawn without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
                                                        e.effects |= EF_NODEPTHTEST;
                                                        setmodel(e, self.model);
                                                        e.frame = self.frame;
@@ -358,7 +364,7 @@ void ImpulseCommands (void)
                                                }
                                        }
                                        if(i)
-                                               print(ftos(i), " spawnpoints have no nearest waypoint (marked by player model)\n");
+                                               LOG_INFO(ftos(i), " spawnpoints have no nearest waypoint (marked by player model)\n");
                                        i = 0;
                                        entity start;
                                        start = findchainflags(flags, FL_ITEM);
@@ -374,14 +380,14 @@ void ImpulseCommands (void)
                                                }
                                                else
                                                {
-                                                       print("item without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
+                                                       LOG_INFO("item without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
                                                        e.effects |= EF_NODEPTHTEST | EF_RED;
                                                        e.colormod_x = 8;
                                                        ++i;
                                                }
                                        }
                                        if(i)
-                                               print(ftos(i), " items have no nearest waypoint and cannot be walked away from (marked with red light)\n");
+                                               LOG_INFO(ftos(i), " items have no nearest waypoint and cannot be walked away from (marked with red light)\n");
                                        i = 0;
                                        for(e = start; e; e = e.chain)
                                        {
@@ -391,20 +397,16 @@ void ImpulseCommands (void)
                                                }
                                                else
                                                {
-                                                       print("item without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
+                                                       LOG_INFO("item without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
                                                        e.effects |= EF_NODEPTHTEST | EF_BLUE;
                                                        e.colormod_z = 8;
                                                        ++i;
                                                }
                                        }
                                        if(i)
-                                               print(ftos(i), " items have no nearest waypoint and cannot be walked to (marked with blue light)\n");
+                                               LOG_INFO(ftos(i), " items have no nearest waypoint and cannot be walked to (marked with blue light)\n");
                                        break;
                        }
                }
        }
-#ifdef TETRIS
-       else if(imp == 100)
-               TetrisImpulse();
-#endif
 }