mirror of
https://github.com/correl/mage.git
synced 2024-11-25 03:00:11 +00:00
Game: fixed empty range error on game startup
This commit is contained in:
parent
18687fe197
commit
d41ccd11bc
2 changed files with 6 additions and 0 deletions
|
@ -313,6 +313,11 @@ public class GameController implements GameCallback {
|
|||
|
||||
private synchronized void startGame() {
|
||||
if (gameFuture == null) {
|
||||
// workaround to fill range info (cause real range fills after game start, but users must get start event with game data already)
|
||||
for (Player player : game.getPlayers().values()) {
|
||||
player.updateRange(game);
|
||||
}
|
||||
|
||||
for (GameSessionPlayer gameSessionPlayer : getGameSessions()) {
|
||||
gameSessionPlayer.init();
|
||||
}
|
||||
|
|
|
@ -495,6 +495,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
public void updateRange(Game game) {
|
||||
// 20100423 - 801.2c
|
||||
// 801.2c The particular players within each player’s range of influence are determined as each turn begins.
|
||||
// BUT it also uses before game start to fill game and card data in starting game events
|
||||
inRange.clear();
|
||||
inRange.add(this.playerId);
|
||||
inRange.addAll(getAllNearPlayers(game, true));
|
||||
|
|
Loading…
Reference in a new issue