From 9e8a6a0883f674c18f7993499cf6fe22822cf67e Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Fri, 7 Sep 2007 01:30:56 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1301 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/server.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/src/server.cpp b/source/src/server.cpp index adf9d887..3ef500b1 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -126,6 +126,13 @@ struct clientstate : playerstate return state==CS_ALIVE || (state==CS_DEAD && gamemillis - lastdeath <= DEATHMILLIS); } + bool waitexpired(int gamemillis) + { + int wait = gamemillis - lastshot; + loopi(NUMGUNS) if(wait < gunwait[i]) return false; + return true; + } + void reset() { state = CS_DEAD; @@ -1506,7 +1513,7 @@ void process(ENetPacket *packet, int sender, int chan) // sender may be -1 shot.type = GE_SHOT; #define seteventmillis(event) \ { \ - if(!cl->timesync) \ + if(!cl->timesync || (cl->events.length()==1 && cl->state.waitexpired(gamemillis))) \ { \ cl->timesync = true; \ cl->gameoffset = gamemillis - getint(p); \