traceline(vehic.origin, vehic.origin + '0 0 1', MOVE_NOMONSTERS, this);
int cont = trace_dpstartcontents;
- if(cont & DPCONTENTS_WATER)
+ if(!(cont & DPCONTENTS_WATER))
vehic.air_finished = time + autocvar_g_vehicle_racer_water_time;
if(IS_DEAD(vehic))
PHYS_INPUT_BUTTON_ZOOM(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false;
- if(time >= vehic.vehicle_last_trace)
- {
- crosshair_trace(this);
- vehic.vehicle_last_trace = time + autocvar_g_vehicle_racer_thinkrate;
- }
-
vehic.angles_x *= -1;
// Yaw
crosshair_trace(this);
w_shotdir.z = normalize(trace_endpos - org).z * 0.5;
.entity weaponentity = weaponentities[0];
- WITHSELF(vehic, wep1.wr_think(wep1, vehic, weaponentity, 1));
+ wep1.wr_think(wep1, vehic, weaponentity, 1);
}
if(autocvar_g_vehicle_racer_rocket_locktarget)
{
- if(vehic.vehicle_last_trace == time + autocvar_g_vehicle_racer_thinkrate)
- vehicles_locktarget(vehic, (1 / autocvar_g_vehicle_racer_rocket_locking_time) * frametime,
- (1 / autocvar_g_vehicle_racer_rocket_locking_releasetime) * frametime,
- autocvar_g_vehicle_racer_rocket_locked_time);
+ if(time >= vehic.vehicle_last_trace)
+ {
+ crosshair_trace(this);
+
+ vehicles_locktarget(vehic, (1 / autocvar_g_vehicle_racer_rocket_locking_time) * frametime,
+ (1 / autocvar_g_vehicle_racer_rocket_locking_releasetime) * frametime,
+ autocvar_g_vehicle_racer_rocket_locked_time);
+
+ vehic.vehicle_last_trace = time + autocvar_g_vehicle_racer_thinkrate;
+ }
if(vehic.lock_target)
{
if(vehic.misc_bulletcounter == 1)
{
- racer_fire_rocket_aim(this, "tag_rocket_r", (vehic.lock_strength == 1 && vehic.lock_target) ? vehic.lock_target : world);
+ racer_fire_rocket_aim(this, "tag_rocket_r", (vehic.lock_strength == 1 && vehic.lock_target) ? vehic.lock_target : NULL);
this.vehicle_ammo2 = 50;
}
else if(vehic.misc_bulletcounter == 2)
{
- racer_fire_rocket_aim(this, "tag_rocket_l", (vehic.lock_strength == 1 && vehic.lock_target) ? vehic.lock_target : world);
+ racer_fire_rocket_aim(this, "tag_rocket_l", (vehic.lock_strength == 1 && vehic.lock_target) ? vehic.lock_target : NULL);
vehic.lock_strength = 0;
- vehic.lock_target = world;
+ vehic.lock_target = NULL;
vehic.misc_bulletcounter = 0;
vehic.delay = time + autocvar_g_vehicle_racer_rocket_refire;
vehic.lip = time;
setorigin(this.owner , spot);
}
antilag_clear(this.owner, CS(this.owner));
- this.owner = world;
+ this.owner = NULL;
}
void racer_blowup(entity this)
RadiusDamage (this, this.enemy, autocvar_g_vehicle_racer_blowup_coredamage,
autocvar_g_vehicle_racer_blowup_edgedamage,
- autocvar_g_vehicle_racer_blowup_radius, world, world,
+ autocvar_g_vehicle_racer_blowup_radius, NULL, NULL,
autocvar_g_vehicle_racer_blowup_forceintensity,
- DEATH_VH_WAKI_DEATH.m_id, world);
+ DEATH_VH_WAKI_DEATH.m_id, NULL);
this.nextthink = time + autocvar_g_vehicle_racer_respawntime;
setthink(this, vehicles_spawn);
CSQCMODEL_AUTOUPDATE(this);
}
-void racer_deadtouch(entity this)
+void racer_deadtouch(entity this, entity toucher)
{
this.avelocity_x *= 0.7;
this.cnt -= 1;
#endif // SVQC
-#ifdef CSQC
-#if 0
-void racer_draw(entity this)
-{
- float pushdeltatime = time - this.lastpushtime;
- if (pushdeltatime > 0.15) pushdeltatime = 0;
- this.lastpushtime = time;
- if(!pushdeltatime) return;
-
- tracebox(this.move_origin, this.mins, this.maxs, this.move_origin - ('0 0 1' * STAT(VEH_RACER_SPRINGLENGTH)), MOVE_NOMONSTERS, this);
-
- vector df = this.move_velocity * -STAT(VEH_RACER_FRICTION);
- df_z += (1 - trace_fraction) * STAT(VEH_RACER_HOVERPOWER) + sin(time * 2) * (STAT(VEH_RACER_SPRINGLENGTH) * 2);
-
- float forced = STAT(VEH_RACER_UPFORCEDAMPER);
-
- int cont = pointcontents(this.move_origin - '0 0 64');
- if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
- {
- forced = STAT(VEH_RACER_WATER_UPFORCEDAMPER);
- this.move_velocity_z += 200;
- }
-
- this.move_velocity += df * pushdeltatime;
- if(this.move_velocity_z > 0)
- this.move_velocity_z *= 1 - forced * pushdeltatime;
-
- this.move_angles_x *= 1 - (STAT(VEH_RACER_ANGLESTABILIZER) * pushdeltatime);
- this.move_angles_z *= 1 - (STAT(VEH_RACER_ANGLESTABILIZER) * pushdeltatime);
-
- Movetype_Physics_MatchServer(this, false);
-}
-#endif
-#endif
-
METHOD(Racer, vr_impact, void(Racer thisveh, entity instance))
{
#ifdef SVQC
METHOD(Racer, vr_death, void(Racer thisveh, entity instance))
{
#ifdef SVQC
- instance.SendEntity = func_null; // stop networking this racer (for now)
+ setSendEntity(instance, func_null); // stop networking this racer (for now)
instance.health = 0;
instance.event_damage = func_null;
instance.solid = SOLID_CORPSE;