@@ -130,13 +130,20 @@ public GameWorld(LiveMap gm, RobotControlProvider cp, GameMaker.MatchMaker match
130130 towersByLoc [i ] = Team .NEUTRAL ;
131131 }
132132 for (int i = 0 ; i < initialBodies .length ; i ++) {
133- RobotInfo robot = initialBodies [i ];
134- MapLocation newLocation = robot .location .translate (gm .getOrigin ().x , gm .getOrigin ().y );
135- spawnRobot (robot .ID , robot .type , newLocation , robot .team );
133+ RobotInfo robotInfo = initialBodies [i ];
134+ MapLocation newLocation = robotInfo .location .translate (gm .getOrigin ().x , gm .getOrigin ().y );
135+ spawnRobot (robotInfo .ID , robotInfo .type , newLocation , robotInfo .team );
136136 this .towerLocations .add (newLocation );
137- towersByLoc [locationToIndex (newLocation )] = robot .team ;
137+ towersByLoc [locationToIndex (newLocation )] = robotInfo .team ;
138138 this .allRuinsByLoc [locationToIndex (newLocation )] = true ;
139139 this .allRuins .add (newLocation );
140+
141+ // Start initial towers at level 2. Defer upgrade action until the tower's first
142+ // turn since client only supports actions this way
143+ InternalRobot robot = getRobot (newLocation );
144+ UnitType newType = robot .getType ().getNextLevel ();
145+ robot .upgradeTower (newType );
146+ upgradeTower (newType , robot .getTeam ());
140147 }
141148 }
142149
0 commit comments