From d22f17ca9ca038d46ee4c676175d2142764ba2f4 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 23 Oct 2016 20:37:04 +0200 Subject: [PATCH] Revert "Rename VehicleSpawn mutator hook to VehicleInit and invert the returned value as it makes more sense" This reverts commit ba479caf23cd515c9741eb6595dad2044a1fa826. --- qcsrc/common/vehicles/sv_vehicles.qc | 4 ++-- qcsrc/server/mutators/events.qh | 6 +++--- qcsrc/server/mutators/mutator/gamemode_assault.qc | 6 ++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index cd62f0746..60a8ee077 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -900,7 +900,7 @@ bool vehicle_impulse(entity this, int imp) void vehicles_enter(entity pl, entity veh) { - // Remove this when bots know how to use vehicles + // Remove this when bots know how to use vehicles if((IS_BOT_CLIENT(pl) && !autocvar_g_vehicles_allow_bots)) return; @@ -1224,7 +1224,7 @@ bool vehicle_initialize(entity this, Vehicle info, bool nodrop) else this.nextthink = time + game_starttime; - if(!MUTATOR_CALLHOOK(VehicleInit, this)) + if(MUTATOR_CALLHOOK(VehicleSpawn, this)) return false; return true; diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index 88d731e81..f75b74748 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -540,12 +540,12 @@ MUTATOR_HOOKABLE(HelpMePing, EV_HelpMePing); /** * called when a vehicle initializes - * return false to remove the vehicle + * return true to remove the vehicle */ -#define EV_VehicleInit(i, o) \ +#define EV_VehicleSpawn(i, o) \ /** vehicle */ i(entity, MUTATOR_ARGV_0_entity) \ /**/ -MUTATOR_HOOKABLE(VehicleInit, EV_VehicleInit); +MUTATOR_HOOKABLE(VehicleSpawn, EV_VehicleSpawn); /** * called when a player enters a vehicle diff --git a/qcsrc/server/mutators/mutator/gamemode_assault.qc b/qcsrc/server/mutators/mutator/gamemode_assault.qc index c50fc6d6f..6af1c1c46 100644 --- a/qcsrc/server/mutators/mutator/gamemode_assault.qc +++ b/qcsrc/server/mutators/mutator/gamemode_assault.qc @@ -529,13 +529,11 @@ MUTATOR_HOOKFUNCTION(as, TurretSpawn) turret.team = 5; // this gets reversed when match starts? } -MUTATOR_HOOKFUNCTION(as, VehicleInit) +MUTATOR_HOOKFUNCTION(as, VehicleSpawn) { entity veh = M_ARGV(0, entity); - if(veh.active != ACTIVE_NOT) - veh.nextthink = time + 0.5; - return true; + veh.nextthink = time + 0.5; } MUTATOR_HOOKFUNCTION(as, HavocBot_ChooseRole) -- 2.39.2