Commit 3d48f0f6 authored by Lucas Delcros's avatar Lucas Delcros

entities spawn is now checked is speciesArray (see issue)

parent ed3617c8
......@@ -164,7 +164,8 @@ public final class MapBuilder implements Serializable{
int jj=rooms.get(room).j1+r.nextInt(rooms.get(room).width);
int posY=ii*Point.TileScale;
int posX=jj*Point.TileScale;
if(tb[jj][ii].getType() != TileType.WATER) entities.add(SpeciesArray.create(posX,posY,100,"Ronflex","Monster "+i));
//if(tb[jj][ii].getType() != TileType.WATER) entities.add(SpeciesArray.create(posX,posY,100,"Ronflex","Monster "+i));
if(SpeciesArray.canSpawn(Point.construct(posX, posY), "Ronflex")) entities.add(SpeciesArray.create(posX,posY,100,"Ronflex","Monster "+i));
}
}
......
......@@ -32,5 +32,5 @@ public class MapTests {
Map map = SurfacesMapGeneration.roomsRandomGeneration(20, 500);
assertFalse("The player has spawn on water !", map.getTileAt(map.getPositionPlayerStart()).getType() == TileType.WATER);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment