entity vh_player; // player
entity vh_vehicle; // vehicle
+MUTATOR_HOOKABLE(VehicleTouch);
+ // called when a player touches a vehicle
+ // return TRUE to stop player from entering the vehicle
+ // INPUT
+ entity self; // vehicle
+ entity other; // player
+
MUTATOR_HOOKABLE(VehicleExit);
// called when a player exits a vehicle
// allows mutators to set special settings in this event
return 0;
}
+MUTATOR_HOOKFUNCTION(freezetag_VehicleTouch)
+{
+ if(other.freezetag_frozen)
+ return TRUE;
+
+ return FALSE;
+}
+
void freezetag_Initialize()
{
precache_model("models/ice/ice.md3");
MUTATOR_HOOK(HavocBot_ChooseRule, freezetag_BotRoles, CBC_ORDER_ANY);
MUTATOR_HOOK(SpectateCopy, freezetag_SpectateCopy, CBC_ORDER_ANY);
MUTATOR_HOOK(GetTeamCount, freezetag_GetTeamCount, CBC_ORDER_EXCLUSIVE);
+ MUTATOR_HOOK(VehicleTouch, freezetag_VehicleTouch, CBC_ORDER_ANY);
MUTATOR_ONADD
{
return TRUE;
if(e.flags & FL_MONSTER)
- return TRUE; // more bitflags for everyone!
+ return TRUE;
return FALSE;
}
if(self.team)
if(self.team != other.team)
return;
+
+ if(MUTATOR_CALLHOOK(VehicleTouch))
+ return;
RemoveGrapplingHook(other);
if(!teamplay)
_vehicle.team = 0;
- else
vh_player = _player;
vh_vehicle = _vehicle;
self.vehicle_respawntime = _respawntime;
self.vehicle_spawn = spawnproc;
self.effects = EF_NODRAW;
+ self.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_SOLID;
if(!autocvar_g_vehicles_delayspawn)
- self.nextthink = time + 0.5;
+ self.nextthink = time + game_starttime;
else
self.nextthink = time + _respawntime + (random() * autocvar_g_vehicles_delayspawn_jitter);
+ if(autocvar_g_playerclip_collisions)
+ self.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP;
if(autocvar_g_nodepthtestplayers)
self.effects = self.effects | EF_NODEPTHTEST;