float autocvar_g_vehicles_crush_dmg;
float autocvar_g_vehicles_crush_force;
+float autocvar_g_vehicles_delayspawn;
+float autocvar_g_vehicles_delayspawn_jitter;
void vehicles_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
void vehicles_return();
/** AuxiliaryXhair*
- Send addictional points of interest to be drawn, to vehicle owner
+ Send additional points of interest to be drawn, to vehicle owner
**/
float MAX_AXH = 4;
.entity AuxiliaryXhair[MAX_AXH];
*/
// End AuxiliaryXhair
+/**
+ Notifies the client that he enterd a vehicle, and sends
+ realavent data.
+
+ only sends vehicle_id atm (wich is a HUD_* constant, ex. HUD_SPIDERBOT)
+**/
void CSQCVehicleSetup(entity own, float vehicle_id)
{
msg_entity = own;
return;
}
-
if(trace_ent != world)
{
// Generic vehile projectile system
void vehicles_projectile_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
+ // Ignore damage from oterh projectiles from my owner (dont mess up volly's)
+ if(inflictor.owner == self.owner)
+ return;
+
self.health -= damage;
self.velocity += force;
if(self.health < 1)
// End generic vehile projectile system
/** vehicles_spawn
- Exetuted for all vehiles on (re)spawn.
+ Exetuted for all vehicles on (re)spawn.
Sets defaults for newly spawned units.
**/
void vehicles_spawn()
// .viewmodelforclient works better.
//self.vehicle_hudmodel.drawonlytoclient = self.owner;
-#ifndef VEHICLES_CSQC
- self.vehicle_hudmodel.viewmodelforclient = self.owner;
-#endif
+ self.vehicle_hudmodel.viewmodelforclient = self.owner;
self.event_damage = vehicles_damage;
self.nextthink = 0;
self.team = self.owner.team;
self.flags -= FL_NOTARGET;
-#ifndef VEHICLES_CSQC
msg_entity = other;
WriteByte (MSG_ONE, SVC_SETVIEWPORT);
WriteEntity(MSG_ONE, self.vehicle_viewport);
WriteAngle(MSG_ONE, self.angles_y); // yaw
WriteAngle(MSG_ONE, 0); // roll
}
-#endif
-//#endif
vehicles_clearrturn();
self.vehicle_enter();
}
+/** vehicles_findgoodexit
+ Locates a valid location for the player to exit the vehicle.
+ Will first try prefer_spot, then up 100 random spots arround the vehicle
+ wich are in direct line of sight and empty enougth to hold a players bbox
+**/
vector vehicles_findgoodexit(vector prefer_spot)
{
vector exitspot;
return self.origin;
}
+/** vehicles_exit
+ Standarrd vehicle release fucntion.
+ custom code goes in self.vehicle_exit
+**/
void vehicles_exit(float eject)
-{
+{
self.flags |= FL_NOTARGET;
if (self.owner)
ret.nextthink = time + 0.1;
return;
}
-
ret = ret.chain;
}
}
ret.enemy = self;
ret.think = vehicles_return;
ret.nextthink = time + self.vehicle_respawntime;
-}
-
-float vehicles_customizeentityforclient()
-{
- if(self.deadflag == DEAD_DEAD)
- return FALSE;
- else
- return TRUE;
-}
+}
void vehicles_configcheck(string configname, float check_cvar)
{
self.iscreature = TRUE;
self.hud = vhud;
- //self.customizeentityforclient = vehicles_customizeentityforclient;
self.vehicle_die = dieproc;
self.vehicle_exit = exitfunc;
self.vehicle_enter = enterproc;
self.PlayerPhysplug = physproc;
self.event_damage = vehicles_damage;
self.touch = vehicles_touch;
- self.think = vehicles_spawn;
- self.nextthink = time;
+ self.think = vehicles_spawn;
+ self.nextthink = time;
self.vehicle_respawntime = _respawntime;
self.vehicle_spawn = spawnproc;
self.pos1 = self.origin;
self.pos2 = self.angles;
-#ifdef VEHICLES_CSQC
- if(use_csqc)
- net_link_vehile();
-#endif
+
return TRUE;
}
-
void bugmenot()
{
self.vehicle_exit = self.vehicle_exit;