- #global thing
- #if game.tourn is None:
- # while True:
- # thing.location = randplace(GALSIZE)
- # # Put it somewhere a starbase is not
- # if thing.location not in game.state.baseq:
- # break
+ if game.tourn is None:
+ # Avoid distrubing the RNG chain. This code
+ # was a late fix and we don't want to mess up
+ # all the regression tests.
+ state = randomizer.getrngstate()
+ while True:
+ thing.location = randplace(GALSIZE)
+ # Put it somewhere a starbase is not
+ if thing.location not in game.state.baseq:
+ break
+ randomizer.setrngstate(state)