self.oldvelocity = self.velocity = self.personal.velocity;
self.angles = self.personal.v_angle;
self.fixangle = TRUE;
- if(self.flagcarried)
- {
- bprint("The ", self.flagcarried.netname, " was returned to base by its carrier\n");
- ctf_RespawnFlag(self); // FIXCTF
- }
- }
- if(g_ctf)
- {
- self.ammo_rockets = 999;
- self.ammo_nails = 999;
- self.ammo_cells = 999;
- self.ammo_shells = 999;
- self.ammo_fuel = 999;
- self.health = start_health;
- self.armorvalue = start_armorvalue;
- WEPSET_OR_EA(self.personal, weaponsInMap);
- self.pauserotarmor_finished = time + autocvar_g_balance_pause_armor_rot_spawn;
- self.pauserothealth_finished = time + autocvar_g_balance_pause_health_rot_spawn;
- self.pauserotfuel_finished = time + autocvar_g_balance_pause_fuel_rot_spawn;
- self.pauseregen_finished = time + autocvar_g_balance_pause_health_regen_spawn;
- self.strength_finished = 0;
- self.invincible_finished = 0;
- }
- else
- {
- self.ammo_rockets = self.personal.ammo_rockets;
- self.ammo_nails = self.personal.ammo_nails;
- self.ammo_cells = self.personal.ammo_cells;
- self.ammo_shells = self.personal.ammo_shells;
- self.ammo_fuel = self.personal.ammo_fuel;
- self.health = self.personal.health;
- self.armorvalue = self.personal.armorvalue;
- WEPSET_COPY_EE(self, self.personal);
- self.items = self.personal.items;
- self.pauserotarmor_finished = time + self.personal.pauserotarmor_finished - self.personal.teleport_time;
- self.pauserothealth_finished = time + self.personal.pauserothealth_finished - self.personal.teleport_time;
- self.pauserotfuel_finished = time + self.personal.pauserotfuel_finished - self.personal.teleport_time;
- self.pauseregen_finished = time + self.personal.pauseregen_finished - self.personal.teleport_time;
- self.strength_finished = time + self.personal.strength_finished - self.personal.teleport_time;
- self.invincible_finished = time + self.personal.invincible_finished - self.personal.teleport_time;
+
+ MUTATOR_CALLHOOK(AbortSpeedrun);
}
+
+ self.ammo_rockets = self.personal.ammo_rockets;
+ self.ammo_nails = self.personal.ammo_nails;
+ self.ammo_cells = self.personal.ammo_cells;
+ self.ammo_shells = self.personal.ammo_shells;
+ self.ammo_fuel = self.personal.ammo_fuel;
+ self.health = self.personal.health;
+ self.armorvalue = self.personal.armorvalue;
+ WEPSET_COPY_EE(self, self.personal);
+ self.items = self.personal.items;
+ self.pauserotarmor_finished = time + self.personal.pauserotarmor_finished - self.personal.teleport_time;
+ self.pauserothealth_finished = time + self.personal.pauserothealth_finished - self.personal.teleport_time;
+ self.pauserotfuel_finished = time + self.personal.pauserotfuel_finished - self.personal.teleport_time;
+ self.pauseregen_finished = time + self.personal.pauseregen_finished - self.personal.teleport_time;
+ self.strength_finished = time + self.personal.strength_finished - self.personal.teleport_time;
+ self.invincible_finished = time + self.personal.invincible_finished - self.personal.teleport_time;
+
DID_CHEAT();
break;
}
// called when a player enters a vehicle
// allows mutators to set special settings in this event
// INPUT
- entity other; // the player
- entity self; // the vehicle
+ entity other; // player
+ entity self; // vehicle
MUTATOR_HOOKABLE(VehicleExit);
// called when a player exits a vehicle
// allows mutators to set special settings in this event
// INPUT
- entity other; // the player
- entity self; // the vehicle
\ No newline at end of file
+ entity other; // player
+ entity self; // vehicle
+
+MUTATOR_HOOKABLE(AbortSpeedrun);
+ // called when a speedrun is aborted and the player is teleported back to start position
+ // INPUT
+ entity self; // player
\ No newline at end of file
flag.ctf_status = FLAG_CARRY;
// messages and sounds
- sound(player, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTN_NORM);
+ sound(player, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTN_NORM); // FIXCTF
ctf_EventLog("recieve", flag.team, player);
FOR_EACH_REALPLAYER(tmp_player)
if(tmp_player == sender)
return 0;
}
+MUTATOR_HOOKFUNCTION(ctf_AbortSpeedrun)
+{
+ if(self.flagcarried)
+ {
+ bprint("The ", self.flagcarried.netname, " was returned to base by its carrier\n");
+ ctf_RespawnFlag(self);
+ }
+
+ return 0;
+}
+
// ==========
// Spawnfuncs
MUTATOR_HOOK(HelpMePing, ctf_HelpMePing, CBC_ORDER_ANY);
MUTATOR_HOOK(VehicleEnter, ctf_VehicleEnter, CBC_ORDER_ANY);
MUTATOR_HOOK(VehicleExit, ctf_VehicleExit, CBC_ORDER_ANY);
+ MUTATOR_HOOK(AbortSpeedrun, ctf_AbortSpeedrun, CBC_ORDER_ANY);
MUTATOR_ONADD
{