From b698a1148bbdd01b66670b356708425e6c1e5bf7 Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 26 Dec 2006 18:19:35 +0000 Subject: [PATCH] Should fix the slow rockets bugs. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2449 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/server/progdefs.h | 2 +- engine/server/server.h | 1 + engine/server/sv_main.c | 1 + engine/server/sv_phys.c | 4 ++-- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/engine/server/progdefs.h b/engine/server/progdefs.h index 83e093a3a..323777332 100644 --- a/engine/server/progdefs.h +++ b/engine/server/progdefs.h @@ -90,7 +90,7 @@ typedef struct entvars_s vec3_t absmin; vec3_t absmax; float ltime; - float lastruntime; + int lastruntime; float movetype; float solid; vec3_t origin; diff --git a/engine/server/server.h b/engine/server/server.h index 850daffe4..c6edcaf56 100644 --- a/engine/server/server.h +++ b/engine/server/server.h @@ -696,6 +696,7 @@ typedef struct gametype_e gametype; int spawncount; // number of servers spawned since start, // used to check late spawns + int framenum; //physics frame number for out-of-sequence thinks (fix for slow rockets) int socketip; int socketip6; diff --git a/engine/server/sv_main.c b/engine/server/sv_main.c index c2725b9ae..a961bf9e1 100644 --- a/engine/server/sv_main.c +++ b/engine/server/sv_main.c @@ -2805,6 +2805,7 @@ void SV_Frame (void) start = Sys_DoubleTime (); svs.stats.idle += start - end; end = start; + svs.framenum++; // keep the random time dependent rand (); diff --git a/engine/server/sv_phys.c b/engine/server/sv_phys.c index 01db6d44b..9b37b1621 100644 --- a/engine/server/sv_phys.c +++ b/engine/server/sv_phys.c @@ -1730,9 +1730,9 @@ void SV_RunEntity (edict_t *ent) } else { - if (ent->v->lastruntime == (float)realtime) + if (ent->v->lastruntime == svs.framenum) return; - ent->v->lastruntime = (float)realtime; + ent->v->lastruntime = svs.framenum; }