From 1b3b3b3eb8626be88f0f176d216a47b677e1fee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Mon, 10 Aug 2009 22:06:54 +0200 Subject: [PATCH] Remove global var "gountil" --- game.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/game.c b/game.c index c6bbb07..0a28b5a 100644 --- a/game.c +++ b/game.c @@ -35,7 +35,7 @@ static int framecount = 0; char playername[16]; -static int gountil, mycount; +static int mycount; static int bonustotal; static const int bonuschances[]= { @@ -106,7 +106,7 @@ static void initplayers(void) { } static void firstzero(void) { - gountil=mycount=mydatacount=0; + mycount = mydatacount = 0; memset(latestactions,0,sizeof(latestactions)); memset(latestcounts,0,sizeof(latestcounts)); memset(actionblock,0,sizeof(actionblock)); @@ -836,6 +836,7 @@ static int getaction(void) { static int iterate(void) { int i; + int gountil; /* destination tick */ static int deathcount = 0; mypause(); @@ -847,13 +848,13 @@ static int iterate(void) { myaction = getaction(); if (NETWORK_NONE == network && myaction==ACT_QUIT) return CODE_QUIT; - i = networktraffic(); - if(i<0) - gountil=mycount+1; - else - gountil=i; + if (NETWORK_NONE == network) { + gountil = mycount + 1; /* single step in singly player mode */ + } else { + gountil = networktraffic(); /* as master single step, as slave as many as we can do */ + } - while(mycountnext) { if(!(pl->flags & FLG_DEAD)) ++i; else deadplayers++; - pl=pl->next; } if (deadplayers > 0 && (!i || (NETWORK_NONE != network && i==1))) { ++deathcount;