From fc45a926d506b696b8cdc81c827d0b5990217c27 Mon Sep 17 00:00:00 2001 From: meep-eep Date: Sun, 29 Oct 2006 04:39:41 +0000 Subject: [PATCH] Debugging trick, comment. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2479 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/netplay/netmelee.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/sc2/src/sc2code/netplay/netmelee.c b/sc2/src/sc2code/netplay/netmelee.c index 12baae743..3e608eec0 100644 --- a/sc2/src/sc2code/netplay/netmelee.c +++ b/sc2/src/sc2code/netplay/netmelee.c @@ -239,9 +239,24 @@ networkBattleInput(COUNT player, STARSHIPPTR StarShipPtr) { BATTLE_INPUT_STATE result; for (;;) { - bool ok = BattleInputBuffer_pop(bib, &result); - // Get the input from the front of the - // buffer. + bool ok; + +#if 0 + // This is a useful debugging trick. By enabling this #if + // block, this side will always lag the maximum number of frames + // behind the other side. When the remote side stops on some event + // (a breakpoint or so), this side will stop too, waiting for input + // in the loop below, but it won't have processed the frame that + // triggered the event yet. If you then jump over this 'if' + // statement here, you can walk through the decisive frames + // manually. Works best with no input delay. + if (bib->size <= getBattleInputDelay() + 1) { + ok = false; + } else +#endif + ok = BattleInputBuffer_pop(bib, &result); + // Get the input from the front of the + // buffer. if (ok) break;