]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Vehicles: refer to registered impulse commands
authorTimePath <andrew.hardaker1995@gmail.com>
Mon, 7 Dec 2015 06:11:27 +0000 (17:11 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 7 Dec 2015 06:11:27 +0000 (17:11 +1100)
qcsrc/common/physics.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/vehicles/vehicle/spiderbot.qc

index f7551e253a5341be8df131b048529c4a3f011f05..64b53b3a7dc8e9cbde06f6f3c5a3142747f2d1a9 100644 (file)
@@ -628,7 +628,7 @@ string specialcommand = "xwxwxsxsxaxdxaxdx1x ";
 void SpecialCommand()
 {
 #ifdef SVQC
-       if (!CheatImpulse(99))
+       if (!CheatImpulse(CHIMPULSE_GIVE_ALL.impulse))
                LOG_INFO("A hollow voice says \"Plugh\".\n");
 #endif
 }
index a2cbbb7e2cb362276df61b03d15d19d65809857b..2940b95653399d1c382e0af785055887a9664033 100644 (file)
@@ -960,7 +960,7 @@ bool vehicle_impulse(entity this, int imp)
        if (f && f(imp)) return true;
        switch (imp)
        {
-               case 17:
+               case IMP_weapon_drop.impulse:
                {
                        stuffcmd(self, "\ntoggle cl_eventchase_vehicle\nset _vehicles_shownchasemessage 1\n");
                        return true;
index a3739322bc7980df470e0890a2eb9bfabde92bcf..7ebac8152adeed819a6d57eb3ad3e290ccf21605 100644 (file)
@@ -569,28 +569,28 @@ float raptor_impulse(float _imp)
 {SELFPARAM();
        switch(_imp)
        {
-               case 1:
+               case IMP_weapon_group_1.impulse:
                        self.vehicle.vehicle_weapon2mode = RSM_BOMB;
                        CSQCVehicleSetup(self, 0);
                        return true;
-               case 2:
+               case IMP_weapon_group_2.impulse:
                        self.vehicle.vehicle_weapon2mode = RSM_FLARE;
                        CSQCVehicleSetup(self, 0);
                        return true;
 
-               case 10:
-               case 15:
-               case 18:
+               case IMP_weapon_next_byid.impulse:
+               case IMP_weapon_next_bypriority.impulse:
+               case IMP_weapon_next_bygroup.impulse:
                        self.vehicle.vehicle_weapon2mode += 1;
                        if(self.vehicle.vehicle_weapon2mode > RSM_LAST)
                                self.vehicle.vehicle_weapon2mode = RSM_FIRST;
 
                        CSQCVehicleSetup(self, 0);
                        return true;
-               case 11:
-               case 12:
-               case 16:
-               case 19:
+               case IMP_weapon_last.impulse:
+               case IMP_weapon_prev_byid.impulse:
+               case IMP_weapon_prev_bypriority.impulse:
+               case IMP_weapon_prev_bygroup.impulse:
                        self.vehicle.vehicle_weapon2mode -= 1;
                        if(self.vehicle.vehicle_weapon2mode < RSM_FIRST)
                                self.vehicle.vehicle_weapon2mode = RSM_LAST;
@@ -599,9 +599,9 @@ float raptor_impulse(float _imp)
                        return true;
 
                /*
-               case 17: // toss gun, could be used to exit?
+               case IMP_weapon_drop.impulse: // toss gun, could be used to exit?
                        break;
-               case 20: // Manual minigun reload?
+               case IMP_weapon_reload.impulse: // Manual minigun reload?
                        break;
                */
        }
index 8cb2487811d61da7bbe89d4286b6f596f5165c55..9c2305126f307795270d869ce1d2d88fc770d8c1 100644 (file)
@@ -497,22 +497,22 @@ bool spiderbot_impulse(int _imp)
 {SELFPARAM();
        switch(_imp)
        {
-               case 1:
+               case IMP_weapon_group_1.impulse:
                        self.vehicle.vehicle_weapon2mode = SBRM_VOLLY;
                        CSQCVehicleSetup(self, 0);
                        return true;
-               case 2:
+               case IMP_weapon_group_2.impulse:
                        self.vehicle.vehicle_weapon2mode = SBRM_GUIDE;
                        CSQCVehicleSetup(self, 0);
                        return true;
-               case 3:
+               case IMP_weapon_group_3.impulse:
                        self.vehicle.vehicle_weapon2mode = SBRM_ARTILLERY;
                        CSQCVehicleSetup(self, 0);
                        return true;
 
-               case 10:
-               case 15:
-               case 18:
+               case IMP_weapon_next_byid.impulse:
+               case IMP_weapon_next_bypriority.impulse:
+               case IMP_weapon_next_bygroup.impulse:
                        self.vehicle.vehicle_weapon2mode += 1;
                        if(self.vehicle.vehicle_weapon2mode > SBRM_LAST)
                                self.vehicle.vehicle_weapon2mode = SBRM_FIRST;
@@ -520,10 +520,10 @@ bool spiderbot_impulse(int _imp)
                        //centerprint(self, strcat("Rocket mode is ", ftos(self.vehicle.vehicle_weapon2mode)));
                        CSQCVehicleSetup(self, 0);
                        return true;
-               case 11:
-               case 12:
-               case 16:
-               case 19:
+               case IMP_weapon_last.impulse:
+               case IMP_weapon_prev_byid.impulse:
+               case IMP_weapon_prev_bypriority.impulse:
+               case IMP_weapon_prev_bygroup.impulse:
                        self.vehicle.vehicle_weapon2mode -= 1;
                        if(self.vehicle.vehicle_weapon2mode < SBRM_FIRST)
                                self.vehicle.vehicle_weapon2mode = SBRM_LAST;
@@ -533,9 +533,9 @@ bool spiderbot_impulse(int _imp)
                        return true;
 
                /*
-               case 17: // toss gun, could be used to exit?
+               case IMP_weapon_drop.impulse: // toss gun, could be used to exit?
                        break;
-               case 20: // Manual minigun reload?
+               case IMP_weapon_reload.impulse: // Manual minigun reload?
                        break;
                */
        }