// take players back into the past
FOR_EACH_PLAYER(player)
if(player != forent)
- antilag_takeback(player, time - lag);
+ {
+ antilag_takeback(player, time - lag);
+ if(player.vehicle)
+ antilag_takeback(player.vehicle, time - lag);
+ }
+
}
// do the trace
{
FOR_EACH_PLAYER(player)
if(player != forent)
- antilag_restore(player);
+ {
+ antilag_restore(player);
+ if(player.vehicle)
+ antilag_restore(player.vehicle);
+ }
+
}
// restore shooter solid type
self.hitsound = FALSE;
self.typehitsound = FALSE;
antilag_record(self, altime);
+ if(self.vehicle)
+ antilag_record(self.vehicle, altime);
}
}
return 1;
}
+
racer_align4point();
-
- crosshair_trace(player);
-
+ vh_crosshair_trace(player);
racer.angles_x *= -1;
// Yaw
player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
return 1;
}
- crosshair_trace(player);
+ vh_crosshair_trace(player);
vector vang;
vang = raptor.angles;
if not (self.owner.BUTTON_ATCK2)
return;
- crosshair_trace(self.owner);
+ vh_crosshair_trace(self.owner);
v = gettaginfo(self.tur_head,gettagindex(self.tur_head,"tag_fire"));
rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav",
dont before calling.
**/
+void vh_crosshair_trace(entity player)
+{
+ float lag;
+ entity pl;
+
+ lag = ANTILAG_LATENCY(self);
+ if(lag < 0.001)
+ lag = 0;
+ if(clienttype(self) != CLIENTTYPE_REAL)
+ lag = 0;
+ if(autocvar_g_antilag == 0 || self.cvar_cl_noantilag)
+ lag = 0; // only do hitscan, but no antilag
+
+ if(lag)
+ FOR_EACH_PLAYER(pl)
+ if(pl != self)
+ {
+ antilag_takeback(pl, time - lag);
+ if(pl.vehicle)
+ antilag_takeback(pl.vehicle, time - lag);
+
+ }
+
+ crosshair_trace(player);
+
+ if(lag)
+ FOR_EACH_PLAYER(pl)
+ if(pl != self)
+ {
+ antilag_restore(pl);
+ if(pl.vehicle)
+ antilag_restore(pl.vehicle);
+ }
+}
.entity lock_target;
.float lock_strength;
.float lock_time;
if(trace_ent.deadflag != DEAD_NO)
trace_ent = world;
- if not (trace_ent.vehicle_flags & VHF_ISVEHICLE || trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
+ if not (trace_ent.vehicle_flags & VHF_ISVEHICLE || trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET || trace_ent.classname == "player")
trace_ent = world;
}
if(lag)
FOR_EACH_PLAYER(pl)
if(pl != self)
- antilag_takeback(pl, time - lag);
+ {
+ antilag_takeback(pl, time - lag);
+ if(pl.vehicle)
+ antilag_takeback(pl.vehicle, time - lag);
+
+ }
+
oldself = self;
self = proj;
if(lag)
FOR_EACH_PLAYER(pl)
if(pl != self)
- antilag_restore(pl);
+ {
+ antilag_restore(pl);
+ if(pl.vehicle)
+ antilag_restore(pl.vehicle);
+ }
+
remove(proj);