summaryrefslogtreecommitdiff
path: root/src/net_client.c
diff options
context:
space:
mode:
authorSimon Howard2006-02-24 19:14:59 +0000
committerSimon Howard2006-02-24 19:14:59 +0000
commitf540202d2a114b3b44cc7f6379e8e59cfa73eff5 (patch)
tree7e992d16426c06f43cc94680c1ebc04317a6156e /src/net_client.c
parentb0d1d3ba2cf621625268f38722b1f6aa819b7c79 (diff)
downloadchocolate-doom-f540202d2a114b3b44cc7f6379e8e59cfa73eff5.tar.gz
chocolate-doom-f540202d2a114b3b44cc7f6379e8e59cfa73eff5.tar.bz2
chocolate-doom-f540202d2a114b3b44cc7f6379e8e59cfa73eff5.zip
Fix -extratics
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 389
Diffstat (limited to 'src/net_client.c')
-rw-r--r--src/net_client.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/net_client.c b/src/net_client.c
index 627561c4..4a52c62b 100644
--- a/src/net_client.c
+++ b/src/net_client.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: net_client.c 383 2006-02-23 20:53:03Z fraggle $
+// $Id: net_client.c 389 2006-02-24 19:14:59Z fraggle $
//
// Copyright(C) 2005 Simon Howard
//
@@ -21,6 +21,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.32 2006/02/24 19:14:59 fraggle
+// Fix -extratics
+//
// Revision 1.31 2006/02/23 20:53:03 fraggle
// Detect when clients are disconnected from the server, recover cleanly
// and display a message.
@@ -392,13 +395,19 @@ void NET_CL_StartGame(void)
// Fill in game settings structure with appropriate parameters
// for the new game
- settings.extratics = 0;
settings.deathmatch = deathmatch;
settings.episode = startepisode;
settings.map = startmap;
settings.skill = startskill;
settings.gameversion = gameversion;
+ i = M_CheckParm("-extratics");
+
+ if (i > 0)
+ settings.extratics = atoi(myargv[i+1]);
+ else
+ settings.extratics = 1;
+
i = M_CheckParm("-dup");
if (i > 0)
@@ -465,6 +474,7 @@ void NET_CL_SendTiccmd(ticcmd_t *ticcmd, int maketic)
{
net_ticdiff_t diff;
net_server_send_t *sendobj;
+ int starttic, endtic;
// Calculate the difference to the last ticcmd
@@ -482,7 +492,13 @@ void NET_CL_SendTiccmd(ticcmd_t *ticcmd, int maketic)
// Send to server.
- NET_CL_SendTics(maketic, maketic);
+ starttic = maketic - extratics;
+ endtic = maketic;
+
+ if (starttic < 0)
+ starttic = 0;
+
+ NET_CL_SendTics(starttic, endtic);
}
// data received while we are waiting for the game to start
@@ -576,7 +592,7 @@ static void NET_CL_ParseGameStart(net_packet_t *packet)
deathmatch = settings.deathmatch;
ticdup = settings.ticdup;
-// extratic = settings.extratics;
+ extratics = settings.extratics;
startepisode = settings.episode;
startmap = settings.map;
startskill = settings.skill;