Further AI handling improvements.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3401 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -56,7 +56,7 @@ public abstract class GameConfig extends PlaceConfig implements Cloneable
|
||||
* players should be null and slots with AIs should contain
|
||||
* configuration for those AIs. A null array indicates no use of AIs
|
||||
* at all. */
|
||||
public GameAI[] ais;
|
||||
public GameAI[] ais = new GameAI[0];
|
||||
|
||||
/**
|
||||
* Returns the message bundle identifier for the bundle that should be
|
||||
|
||||
@@ -87,8 +87,7 @@ public class GameManager extends PlaceManager
|
||||
}
|
||||
|
||||
// configure our AIs
|
||||
int aicount = (_gameconfig.ais == null) ? 0 : _gameconfig.ais.length;
|
||||
for (int ii = 0; ii < aicount; ii++) {
|
||||
for (int ii = 0; ii < _gameconfig.ais.length; ii++) {
|
||||
if (_gameconfig.ais[ii] != null) {
|
||||
setAI(ii, _gameconfig.ais[ii]);
|
||||
}
|
||||
@@ -446,8 +445,8 @@ public class GameManager extends PlaceManager
|
||||
// let the players of this game know that we're ready to roll (if
|
||||
// we have a specific set of players)
|
||||
for (int ii = 0; ii < getPlayerSlots(); ii++) {
|
||||
// skip non-existent players
|
||||
if (!_gameobj.isOccupiedPlayer(ii)) {
|
||||
// skip non-existent players and AIs
|
||||
if (!_gameobj.isOccupiedPlayer(ii) || isAI(ii)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user