// called when a player enters a vehicle
// allows mutators to set special settings in this event
// INPUT
- entity other; // player
- entity self; // vehicle
+ entity vh_player; // player
+ entity vh_vehicle; // vehicle
MUTATOR_HOOKABLE(VehicleExit);
// called when a player exits a vehicle
// allows mutators to set special settings in this event
// INPUT
- entity other; // player
- entity self; // vehicle
+ entity vh_player; // player
+ entity vh_vehicle; // vehicle
MUTATOR_HOOKABLE(AbortSpeedrun);
// called when a speedrun is aborted and the player is teleported back to start position
MUTATOR_HOOKFUNCTION(ctf_VehicleEnter)
{
- if(other.flagcarried)
+ if(vh_player.flagcarried)
{
if(!autocvar_g_ctf_flagcarrier_allow_vehicle_carry)
{
- ctf_Handle_Throw(self, world, DROP_NORMAL);
+ ctf_Handle_Throw(vh_player, world, DROP_NORMAL);
}
else
{
- setattachment(other.flagcarried, self, "");
- setorigin(other, VEHICLE_FLAG_OFFSET);
- other.flagcarried.scale = VEHICLE_FLAG_SCALE;
- //other.flagcarried.angles = '0 0 0';
+ setattachment(vh_player.flagcarried, vh_vehicle, "");
+ setorigin(vh_player.flagcarried, VEHICLE_FLAG_OFFSET);
+ vh_player.flagcarried.scale = VEHICLE_FLAG_SCALE;
+ //vh_player.flagcarried.angles = '0 0 0';
}
}
MUTATOR_HOOKFUNCTION(ctf_VehicleExit)
{
- if(self.owner.flagcarried)
+ if(vh_player.flagcarried)
{
- setattachment(self.owner.flagcarried, self.owner, "");
- setorigin(self.owner.flagcarried, FLAG_CARRY_OFFSET);
- self.owner.flagcarried.scale = FLAG_SCALE;
- self.owner.flagcarried.angles = '0 0 0';
+ setattachment(vh_player.flagcarried, vh_player, "");
+ setorigin(vh_player.flagcarried, FLAG_CARRY_OFFSET);
+ vh_player.flagcarried.scale = FLAG_SCALE;
+ vh_player.flagcarried.angles = '0 0 0';
}
return 0;
self.hud = HUD_NORMAL;
self.switchweapon = self.vehicle.switchweapon;
- // FIXCTF TODO
+ vh_player = self;
+ vh_vehicle = self.vehicle;
+ MUTATOR_CALLHOOK(VehicleExit);
+ self = vh_player;
+ self.vehicle = vh_vehicle;
self.vehicle.vehicle_hudmodel.viewmodelforclient = self.vehicle;
CSQCVehicleSetup(other, other.hud);
- // FIXCTF TODO
+ vh_player = other;
+ vh_vehicle = _gun;
+ MUTATOR_CALLHOOK(VehicleEnter);
+ other = vh_player;
+ _gun = vh_vehicle;
return TRUE;
}
CSQCVehicleSetup(self.owner, self.hud);
+ vh_player = other;
+ vh_vehicle = self;
MUTATOR_CALLHOOK(VehicleEnter);
+ other = vh_player;
+ self = vh_vehicle;
self.vehicle_enter();
antilag_clear(other);
if(!teamplay)
_vehicle.team = 0;
else
-
- self.team = self.tur_head.team;
-
+
+ vh_player = _player;
+ vh_vehicle = _vehicle;
MUTATOR_CALLHOOK(VehicleExit);
+ _player = vh_player;
+ _vehicle = vh_vehicle;
_vehicle.team = _vehicle.tur_head.team;