]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Rename VehicleSpawn mutator hook to VehicleInit and invert the returned value as...
authorterencehill <piuntn@gmail.com>
Tue, 13 Sep 2016 10:51:16 +0000 (12:51 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 13 Sep 2016 10:51:16 +0000 (12:51 +0200)
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/server/mutators/events.qh
qcsrc/server/mutators/mutator/gamemode_assault.qc

index 60a8ee07760fbe897e58cd58fab2e22904337728..cd62f0746b69f6b2dc892f42a1938807cf566d07 100644 (file)
@@ -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(VehicleSpawn, this))
+       if(!MUTATOR_CALLHOOK(VehicleInit, this))
                return false;
 
        return true;
index 3743c6b94978977769c9112e30a024e4d912b86a..cc593ad5d13344d5adb4b9a07afaa6317a258809 100644 (file)
@@ -529,12 +529,12 @@ MUTATOR_HOOKABLE(HelpMePing, EV_HelpMePing);
 
 /**
  * called when a vehicle initializes
- * return true to remove the vehicle
+ * return false to remove the vehicle
  */
-#define EV_VehicleSpawn(i, o) \
+#define EV_VehicleInit(i, o) \
     /** vehicle */ i(entity, MUTATOR_ARGV_0_entity) \
     /**/
-MUTATOR_HOOKABLE(VehicleSpawn, EV_VehicleSpawn);
+MUTATOR_HOOKABLE(VehicleInit, EV_VehicleInit);
 
 /**
  * called when a player enters a vehicle
index a91af90f0fc4d2adac247f735908d1bd7648434b..b032ab01949db9c6453da64da4d96058e9a926ce 100644 (file)
@@ -531,11 +531,13 @@ MUTATOR_HOOKFUNCTION(as, TurretSpawn)
                turret.team = 5; // this gets reversed when match starts?
 }
 
-MUTATOR_HOOKFUNCTION(as, VehicleSpawn)
+MUTATOR_HOOKFUNCTION(as, VehicleInit)
 {
        entity veh = M_ARGV(0, entity);
 
-       veh.nextthink = time + 0.5;
+       if(veh.active != ACTIVE_NOT)
+               veh.nextthink = time + 0.5;
+       return true;
 }
 
 MUTATOR_HOOKFUNCTION(as, HavocBot_ChooseRole)