#include "sv_vehicles.qh"
-#include "../effects/effects.qh"
#if 0
bool vehicle_send(entity to, int sf)
void vehicles_clearreturn(entity veh)
{
- entity ret;
// Remove "return helper", if any.
- ret = findchain(classname, "vehicle_return");
- while(ret)
+ for (entity ret = findchain(classname, "vehicle_return"); ret; ret = ret.chain)
{
if(ret.wp00 == veh)
{
return;
}
- ret = ret.chain;
}
}
rgb = Team_ColorRGB(self.team);
else
rgb = '1 1 1';
- entity wp = WaypointSprite_Spawn(WP_Vehicle, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_POWERUP);
+ entity wp = WaypointSprite_Spawn(WP_Vehicle, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_Vehicle);
wp.colormod = rgb;
if(self.waypointsprite_attached)
{
vehicles_clearreturn(veh);
- ret = spawn();
- ret.classname = "vehicle_return";
+ ret = new(vehicle_return);
ret.wp00 = veh;
ret.team = veh.team;
ret.think = vehicles_showwp;
float _ftmp;
_ftmp = self.owner.vehicle_health / 50;
self.pain_frame = time + 0.1 + (random() * 0.5 * _ftmp);
- pointparticles(particleeffectnum(EFFECT_SMOKE_SMALL), (self.origin + (randomvec() * 80)), '0 0 0', 1);
+ pointparticles(EFFECT_SMOKE_SMALL, (self.origin + (randomvec() * 80)), '0 0 0', 1);
if(self.vehicle_flags & VHF_DMGSHAKE)
self.velocity += randomvec() * 30;
self.dmg_time = time;
// WEAPONTODO
- if(DEATH_ISWEAPON(deathtype, WEP_VORTEX.m_id))
+ if(DEATH_ISWEAPON(deathtype, WEP_VORTEX))
damage *= autocvar_g_vehicles_vortex_damagerate;
- if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN.m_id))
+ if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN))
damage *= autocvar_g_vehicles_machinegun_damagerate;
- if(DEATH_ISWEAPON(deathtype, WEP_RIFLE.m_id))
+ if(DEATH_ISWEAPON(deathtype, WEP_RIFLE))
damage *= autocvar_g_vehicles_rifle_damagerate;
- if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER.m_id))
+ if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
damage *= autocvar_g_vehicles_vaporizer_damagerate;
- if(DEATH_ISWEAPON(deathtype, WEP_SEEKER.m_id))
+ if(DEATH_ISWEAPON(deathtype, WEP_SEEKER))
damage *= autocvar_g_vehicles_tag_damagerate;
- if(DEATH_WEAPONOFWEAPONDEATH(deathtype))
+ if(DEATH_WEAPONOF(deathtype) != WEP_Null)
damage *= autocvar_g_vehicles_weapon_damagerate;
self.enemy = attacker;
if(_minspeed < wc)
{
float take = min(_speedfac * wc, _maxpain);
- Damage (self, world, world, take, DEATH_FALL, self.origin, '0 0 0');
+ Damage (self, world, world, take, DEATH_FALL.m_id, self.origin, '0 0 0');
self.play_time = time + 0.25;
//dprint("wc: ", ftos(wc), "\n");
if(vehicles_crushable(other))
{
if(vlen(self.velocity) >= 30)
- Damage(other, self, self.owner, autocvar_g_vehicles_crush_dmg, DEATH_VH_CRUSH, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicles_crush_force);
+ Damage(other, self, self.owner, autocvar_g_vehicles_crush_dmg, DEATH_VH_CRUSH.m_id, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicles_crush_force);
return; // Dont do selfdamage when hitting "soft targets".
}
self.vehicle_flags |= VHF_ISVEHICLE;
- self.vehicle_viewport = spawn();
- self.vehicle_hudmodel = spawn();
- self.tur_head = spawn();
+ self.vehicle_viewport = new(vehicle_viewport);
+ self.vehicle_hudmodel = new(vehicle_hudmodel);
+ self.tur_head = new(tur_head);
self.tur_head.owner = self;
self.takedamage = DAMAGE_NO;
self.bot_attack = true;