From c2500248db5d8c01c13fee95f654c503bbc12f82 Mon Sep 17 00:00:00 2001 From: Dave Hoover Date: Wed, 17 Feb 2010 04:40:34 +0000 Subject: [PATCH] Make event/board seeding actually do it RIGHT Requesting N bits on certain types of events was enough to tickle timing issues with events between client & server so I got those cleared up, and in a roundabout way made piece prediction harder, BUT it wasn't actually doing what I'd really intended. I'd originally done things this way (call something on the RNG N times) and then in a brief moment of brilliant stupidity went "gee, next() does different stuff based on the number of bits you asked for, so clearly it'll mix things up" Man, this hairshirt is itchy. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@899 c613c5cb-e716-0410-b11b-feb51c14d237 --- src/java/com/threerings/puzzle/data/Board.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/puzzle/data/Board.java b/src/java/com/threerings/puzzle/data/Board.java index bd8983ca..f231274a 100644 --- a/src/java/com/threerings/puzzle/data/Board.java +++ b/src/java/com/threerings/puzzle/data/Board.java @@ -96,7 +96,9 @@ public abstract class Board public void seedFromEvent (int pidx, int gevent) { if (isSeedingEvent(pidx, gevent)) { - _rando.next(getSeedForEvent(pidx, gevent)); + for (int ii = 0, jj = getSeedForEvent(pidx, gevent); ii < jj; ii++) { + _rando.next(0); + } } }