Set the AI players only after the puzzle's place object is created.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1801 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: SimulatorManager.java,v 1.13 2002/10/06 00:53:15 mdb Exp $
|
// $Id: SimulatorManager.java,v 1.14 2002/10/15 22:47:48 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.micasa.simulator.server;
|
package com.threerings.micasa.simulator.server;
|
||||||
|
|
||||||
@@ -75,14 +75,6 @@ public class SimulatorManager
|
|||||||
_simClass = simClass;
|
_simClass = simClass;
|
||||||
_playerCount = playerCount;
|
_playerCount = playerCount;
|
||||||
|
|
||||||
// determine the AI player skill level
|
|
||||||
byte skill;
|
|
||||||
try {
|
|
||||||
skill = Byte.parseByte(System.getProperty("skill"));
|
|
||||||
} catch (NumberFormatException nfe) {
|
|
||||||
skill = DEFAULT_SKILL;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// create the game manager and begin its initialization
|
// create the game manager and begin its initialization
|
||||||
// process. the game manager will take care of notifying
|
// process. the game manager will take care of notifying
|
||||||
@@ -102,11 +94,6 @@ public class SimulatorManager
|
|||||||
CreationObserver obs = (_playerCount == 1) ? null : this;
|
CreationObserver obs = (_playerCount == 1) ? null : this;
|
||||||
_gmgr = (GameManager)_plreg.createPlace(config, obs);
|
_gmgr = (GameManager)_plreg.createPlace(config, obs);
|
||||||
|
|
||||||
for (int ii = 1; ii < _playerCount; ii++) {
|
|
||||||
// mark all simulants as AI players
|
|
||||||
_gmgr.setAI(ii, skill);
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.warning("Unable to create game manager [e=" + e + "].");
|
Log.warning("Unable to create game manager [e=" + e + "].");
|
||||||
Log.logStackTrace(e);
|
Log.logStackTrace(e);
|
||||||
@@ -119,6 +106,19 @@ public class SimulatorManager
|
|||||||
// cast the place to the game object for the game we're creating
|
// cast the place to the game object for the game we're creating
|
||||||
_gobj = (GameObject)place;
|
_gobj = (GameObject)place;
|
||||||
|
|
||||||
|
// determine the AI player skill level
|
||||||
|
byte skill;
|
||||||
|
try {
|
||||||
|
skill = Byte.parseByte(System.getProperty("skill"));
|
||||||
|
} catch (NumberFormatException nfe) {
|
||||||
|
skill = DEFAULT_SKILL;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int ii = 1; ii < _playerCount; ii++) {
|
||||||
|
// mark all simulants as AI players
|
||||||
|
_gmgr.setAI(ii, skill);
|
||||||
|
}
|
||||||
|
|
||||||
// resolve the simulant body objects
|
// resolve the simulant body objects
|
||||||
ClientResolutionListener listener = new ClientResolutionListener()
|
ClientResolutionListener listener = new ClientResolutionListener()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user