From: TimePath Date: Mon, 7 Dec 2015 06:11:27 +0000 (+1100) Subject: Vehicles: refer to registered impulse commands X-Git-Tag: xonotic-v0.8.2~1535 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bd2645ddf4d7e7ca133ae7a87c3b85521e5a7e7b;p=xonotic%2Fxonotic-data.pk3dir.git Vehicles: refer to registered impulse commands --- diff --git a/qcsrc/common/physics.qc b/qcsrc/common/physics.qc index f7551e253..64b53b3a7 100644 --- a/qcsrc/common/physics.qc +++ b/qcsrc/common/physics.qc @@ -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 } diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index a2cbbb7e2..2940b9565 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -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; diff --git a/qcsrc/common/vehicles/vehicle/raptor.qc b/qcsrc/common/vehicles/vehicle/raptor.qc index a3739322b..7ebac8152 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qc +++ b/qcsrc/common/vehicles/vehicle/raptor.qc @@ -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; */ } diff --git a/qcsrc/common/vehicles/vehicle/spiderbot.qc b/qcsrc/common/vehicles/vehicle/spiderbot.qc index 8cb248781..9c2305126 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot.qc @@ -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; */ }