]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_impulse.qc
Revert "Merge branch 'TimePath/bot_api' into 'master'\r"
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_impulse.qc
index 45174f2c6008e2c8f914088b8bd9b83090f4c0a5..a594c83c7c93b72876eb6fc3a24f6a47342945e3 100644 (file)
@@ -51,7 +51,7 @@
  */
 
 void ImpulseCommands (void)
-{
+{SELFPARAM();
        int imp;
        vector org;
        float i;
@@ -134,7 +134,10 @@ void ImpulseCommands (void)
                                        W_PreviousWeapon(1);
                                        break;
                                case 20:
-                                       if(!forbidWeaponUse(self)) { WEP_ACTION(self.weapon, WR_RELOAD); }
+                                       if(!forbidWeaponUse(self)) {
+                                               Weapon w = get_weaponinfo(self.weapon);
+                                               w.wr_reload(w);
+                                       }
                                        break;
                        }
                }
@@ -158,11 +161,11 @@ void ImpulseCommands (void)
                else
                        self.impulse = imp; // retry in next frame
        }
-       else if(imp >= 230 && imp <= 253)
+       else if(imp >= WEP_IMPULSE_BEGIN && imp <= WEP_IMPULSE_END)
        {
                if(!self.vehicle)
                if(self.deadflag == DEAD_NO)
-                       W_SwitchWeapon (imp - 230 + WEP_FIRST);
+                       W_SwitchWeapon (imp - WEP_IMPULSE_BEGIN + WEP_FIRST);
                else
                        self.impulse = imp; // retry in next frame
        }
@@ -311,7 +314,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;
@@ -319,14 +322,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;
@@ -335,9 +338,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)
                                        {
@@ -353,9 +356,9 @@ 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);
+                                                       _setmodel(e, self.model);
                                                        e.frame = self.frame;
                                                        e.skin = self.skin;
                                                        e.colormod = '8 0.5 8';
@@ -364,7 +367,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);
@@ -380,14 +383,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)
                                        {
@@ -397,14 +400,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_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;
                        }
                }