about summary refs log tree commit diff
path: root/src/engine
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2007-09-25 21:53:14 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2007-09-25 21:53:14 +0000
commitdbf425f1aa767de7f6415b45d1321d8dd6c05e97 (patch)
tree7ab92e9c5bae5f914e814746c203b4bdc4ef44bd /src/engine
parenta554203943cde311a93090805b40f3d39ccc75d2 (diff)
downloadzcatch-dbf425f1aa767de7f6415b45d1321d8dd6c05e97.tar.gz
zcatch-dbf425f1aa767de7f6415b45d1321d8dd6c05e97.zip
updated ctf a bit
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/client/client.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/engine/client/client.c b/src/engine/client/client.c
index 1fce3833..a518fe39 100644
--- a/src/engine/client/client.c
+++ b/src/engine/client/client.c
@@ -18,6 +18,8 @@
 
 #include <mastersrv/mastersrv.h>
 
+const int prediction_margin = 5;
+
 /*
 	Server Time
 	Client Mirror Time
@@ -726,9 +728,8 @@ static void client_process_packet(NETPACKET *packet)
 						if(inputs[k].tick == input_predtick)
 						{
 							//-1000/50
-							int margin = 1000/50;
 							int64 target = inputs[k].game_time + (time_get() - inputs[k].time);
-							st_update(&predicted_time, target - (int64)(((time_left-margin)/1000.0f)*time_freq()));
+							st_update(&predicted_time, target - (int64)(((time_left-prediction_margin)/1000.0f)*time_freq()));
 							break;
 						}
 					}
@@ -839,14 +840,14 @@ static void client_process_packet(NETPACKET *packet)
 						{
 							// start at 200ms and work from there
 							st_init(&predicted_time, (game_tick+10)*time_freq()/50);
-							st_init(&game_time, (game_tick-2)*time_freq()/50);
+							st_init(&game_time, (game_tick-1)*time_freq()/50);
 							snapshots[SNAP_PREV] = snapshot_storage.first;
 							snapshots[SNAP_CURRENT] = snapshot_storage.last;
 							local_start_time = time_get();
 							client_set_state(CLIENTSTATE_ONLINE);
 						}
 						
-						st_update(&game_time, (game_tick-2)*time_freq()/50);
+						st_update(&game_time, (game_tick-1)*time_freq()/50);
 						
 						// ack snapshot
 						ack_game_tick = game_tick;