From 3e079bc32459a6b20db78c05570be2be490b437f Mon Sep 17 00:00:00 2001 From: Meep-Eep Date: Tue, 29 Dec 2009 20:18:34 +0000 Subject: [PATCH] Fix possible sync loss bug. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3491 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/uqm/ships/pkunk/pkunk.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sc2/src/uqm/ships/pkunk/pkunk.c b/sc2/src/uqm/ships/pkunk/pkunk.c index 723dd2f7d..7257c4e4e 100644 --- a/sc2/src/uqm/ships/pkunk/pkunk.c +++ b/sc2/src/uqm/ships/pkunk/pkunk.c @@ -503,6 +503,8 @@ pkunk_preprocess (ELEMENT *ElementPtr) } } } + +static COUNT LastSound = 0; static void pkunk_postprocess (ELEMENT *ElementPtr) @@ -517,7 +519,6 @@ pkunk_postprocess (ELEMENT *ElementPtr) StarShipPtr->RaceDescPtr->ship_info.max_energy) { COUNT CurSound; - static COUNT LastSound = 0; do { @@ -548,6 +549,11 @@ init_pkunk (void) RaceDescPtr = &pkunk_desc; + LastSound = 0; + // We need to reinitialise it at least each battle, to ensure + // that NetPlay is synchronised if one player played another + // game before playing against a networked opponent. + return (RaceDescPtr); }