Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions engine/src/main/battlecode/world/GameWorld.java
Original file line number Diff line number Diff line change
Expand Up @@ -507,16 +507,16 @@ public void spawnCheese(CheeseMine mine) {
boolean spawn = rand.nextFloat() < mine.generationProbability(currentRound);

if (spawn) {
int dx = rand.nextInt(-GameConstants.SQ_CHEESE_SPAWN_RADIUS, GameConstants.SQ_CHEESE_SPAWN_RADIUS);
int dy = rand.nextInt(-GameConstants.SQ_CHEESE_SPAWN_RADIUS, GameConstants.SQ_CHEESE_SPAWN_RADIUS);
int dx = rand.nextInt(-GameConstants.SQ_CHEESE_SPAWN_RADIUS, GameConstants.SQ_CHEESE_SPAWN_RADIUS+1);
int dy = rand.nextInt(-GameConstants.SQ_CHEESE_SPAWN_RADIUS, GameConstants.SQ_CHEESE_SPAWN_RADIUS+1);

MapLocation ogSpawnLoc = mine.getLocation();
MapLocation pairedSpawnLoc = mine.getPair().getLocation();
CheeseMine pairedMine = mine.getPair();

for (int invalidSpawns = 0; invalidSpawns < 5; invalidSpawns++) {
int pair_dx = gameMap.getSymmetry() == MapSymmetry.VERTICAL ? dx : -dx;
int pair_dy = gameMap.getSymmetry() == MapSymmetry.HORIZONTAL ? dy : -dy;
int pair_dx = gameMap.getSymmetry() == MapSymmetry.HORIZONTAL ? dx : -dx;
int pair_dy = gameMap.getSymmetry() == MapSymmetry.VERTICAL ? dy : -dy;

int cheeseX = mine.getLocation().x + dx;
int cheeseY = mine.getLocation().y + dy;
Expand Down