Stop spawning rovers outside the chunks or warping into other rovers

This commit is contained in:
Marc Di Luzio 2020-06-08 23:46:56 +01:00
parent ae2cb6598a
commit 520f78b5c3
3 changed files with 24 additions and 14 deletions

View file

@ -107,8 +107,8 @@ func TestWorld_RadarFromRover(t *testing.T) {
// Warp the rovers into position
bpos := Vector{-3, -3}
assert.NoError(t, world.WarpRover(a, Vector{0, 0}), "Failed to warp rover")
assert.NoError(t, world.WarpRover(b, bpos), "Failed to warp rover")
assert.NoError(t, world.WarpRover(a, Vector{0, 0}), "Failed to warp rover")
// Spawn the world wall
err = world.Atlas.SpawnWalls()
@ -129,6 +129,7 @@ func TestWorld_RadarFromRover(t *testing.T) {
// O------O-
// OR-----O-
// OOOOOOOO-
PrintTiles(radar)
// Test all expected values
assert.Equal(t, TileRover, radar[1+fullRange])