this.event_damage = func_null;
RadiusDamage (this, this.realowner, this.shot_dmg, 0, this.shot_radius, this, NULL, this.shot_force, this.totalfrags, toucher);
- remove (this);
+ delete (this);
}
void vehicles_projectile_explode_think(entity this)
proj.totalfrags = _deahtype;
proj.solid = SOLID_BBOX;
set_movetype(proj, MOVETYPE_FLYMISSILE);
- proj.flags = FL_PROJECTILE;
+ proj.flags = FL_PROJECTILE;
+ IL_PUSH(g_projectiles, proj);
+ IL_PUSH(g_bot_dodge, proj);
proj.bot_dodge = true;
proj.bot_dodgerating = _dmg;
proj.velocity = _vel;
proj.health = _health;
}
else
- proj.flags = FL_PROJECTILE | FL_NOTARGET;
+ proj.flags |= FL_NOTARGET;
if(_mzlsound != SND_Null)
sound (this, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM);
sound (this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (this.origin + '0 0 100'), '0 0 0', 1);
Send_Effect(EFFECT_EXPLOSION_SMALL, this.wp00.origin + '0 0 64', '0 0 0', 1);
- remove(this);
+ delete(this);
}
void vehicles_gib_touch(entity this, entity toucher)
{
this.alpha -= 0.1;
if(this.cnt >= time)
- remove(this);
+ delete(this);
else
this.nextthink = time + 0.1;
}
entity _slot,
int _hud,
Model _hud_model,
- bool(entity) _framefunc,
+ bool(entity,float) _framefunc,
void(entity,bool) _exitfunc, float(entity, entity) _enterfunc)
{
if(!(_owner.vehicle_flags & VHF_MULTISLOT))
void vehicles_clearreturn(entity veh)
{
// Remove "return helper" entities, if any.
- FOREACH_ENTITY_ENT(wp00, veh,
+ IL_EACH(g_vehicle_returners, it.wp00 == veh,
{
- if(it.classname == "vehicle_return")
- {
- it.classname = "";
- setthink(it, SUB_Remove);
- it.nextthink = time + 0.1;
+ it.classname = "";
+ setthink(it, SUB_Remove);
+ it.nextthink = time + 0.1;
+ IL_REMOVE(g_vehicle_returners, it);
- if(it.waypointsprite_attached)
- WaypointSprite_Kill(it.waypointsprite_attached);
- }
+ if(it.waypointsprite_attached)
+ WaypointSprite_Kill(it.waypointsprite_attached);
});
}
if(this.waypointsprite_attached)
WaypointSprite_Kill(this.waypointsprite_attached);
- remove(this);
+ delete(this);
}
void vehicles_showwp_goaway(entity this)
if(this.waypointsprite_attached)
WaypointSprite_Kill(this.waypointsprite_attached);
- remove(this);
+ delete(this);
}
void vehicles_showwp(entity this)
vehicles_clearreturn(veh);
entity ret = new(vehicle_return);
+ IL_PUSH(g_vehicle_returners, ret);
ret.wp00 = veh;
ret.team = veh.team;
setthink(ret, vehicles_showwp);
void vehicle_use(entity this, entity actor, entity trigger)
{
- LOG_DEBUG("vehicle ", this.netname, " used by ", actor.classname, "\n");
+ LOG_DEBUG("vehicle ", this.netname, " used by ", actor.classname);
this.tur_head.team = actor.team;
if(this.active == ACTIVE_ACTIVE && !IS_DEAD(this) && !gameover)
{
- LOG_DEBUG("Respawning vehicle: ", this.netname, "\n");
+ LOG_DEBUG("Respawning vehicle: ", this.netname);
if(this.effects & EF_NODRAW)
{
setthink(this, vehicles_spawn);
if(vehicles_exit_running)
{
- LOG_TRACE("^1vehicles_exit already running! this is not good...\n");
+ LOG_TRACE("^1vehicles_exit already running! this is not good...");
return;
}
// initialization
void vehicles_spawn(entity this)
{
- LOG_DEBUG("Spawning vehicle: ", this.classname, "\n");
+ LOG_DEBUG("Spawning vehicle: ", this.classname);
// disown & reset
this.vehicle_hudmodel.viewmodelforclient = this;
this.solid = SOLID_SLIDEBOX;
this.takedamage = DAMAGE_AIM;
this.deadflag = DEAD_NO;
+ if(!this.bot_attack)
+ IL_PUSH(g_bot_targets, this);
this.bot_attack = true;
this.flags = FL_NOTARGET;
this.avelocity = '0 0 0';
return false;
if(!this.tur_head)
+ {
info.vr_precache(info);
+ IL_PUSH(g_vehicles, this);
+ }
if(this.targetname && this.targetname != "")
{
this.vehicle_controller = find(NULL, target, this.targetname);
if(!this.vehicle_controller)
{
- LOG_DEBUG("^1WARNING: ^7Vehicle with invalid .targetname\n");
+ LOG_DEBUG("^1WARNING: ^7Vehicle with invalid .targetname");
this.active = ACTIVE_ACTIVE;
}
else
this.tur_head.owner = this;
this.takedamage = DAMAGE_NO;
this.bot_attack = true;
+ IL_PUSH(g_bot_targets, this);
this.iscreature = true;
this.teleportable = false; // no teleporting for vehicles, too buggy
this.damagedbycontents = true;