From 3f7cf41d0713c7f5af9f123b40016585eb210be6 Mon Sep 17 00:00:00 2001 From: Jakob MG Date: Tue, 25 Oct 2011 12:29:01 +0200 Subject: [PATCH] Vehicle antilag, take 2 --- qcsrc/server/antilag.qc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qcsrc/server/antilag.qc b/qcsrc/server/antilag.qc index 8a628a1be..69d291a4e 100644 --- a/qcsrc/server/antilag.qc +++ b/qcsrc/server/antilag.qc @@ -14,6 +14,9 @@ void antilag_dummy() void antilag_record(entity e, float t) { + if(e.vehicle) + antilag_record(e.vehicle, t); + if(time < e.(antilag_times[e.antilag_index])) return; e.antilag_index = e.antilag_index + 1; @@ -24,6 +27,7 @@ void antilag_record(entity e, float t) if(e.antilag_debug) te_spark(antilag_takebackorigin(e, t - e.antilag_debug), '0 0 0', 32); + } // finds the index BEFORE t @@ -75,6 +79,7 @@ vector antilag_takebackorigin(entity e, float t) vector antilag_takebackavgvelocity(entity e, float t0, float t1) { vector o0, o1; + if(t0 >= t1) return '0 0 0'; o0 = antilag_takebackorigin(e, t0); @@ -84,11 +89,17 @@ vector antilag_takebackavgvelocity(entity e, float t0, float t1) void antilag_takeback(entity e, float t) { + if(e.vehicle) + antilag_takeback(e.vehicle, t); + e.antilag_saved_origin = e.origin; setorigin(e, antilag_takebackorigin(e, t)); } void antilag_restore(entity e) { + if(e.vehicle) + antilag_restore(e.vehicle); + setorigin(e, e.antilag_saved_origin); } -- 2.39.2