From 3c9a9136b5e736fc8045675e343e63637da79dab Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Sat, 4 Apr 2020 13:46:21 +0200 Subject: [PATCH 1/2] Update minesweeper.dm --- .../machinery/computer/arcade/minesweeper.dm | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/code/game/machinery/computer/arcade/minesweeper.dm b/code/game/machinery/computer/arcade/minesweeper.dm index 5c30489b00..f8639e85c1 100644 --- a/code/game/machinery/computer/arcade/minesweeper.dm +++ b/code/game/machinery/computer/arcade/minesweeper.dm @@ -382,18 +382,26 @@ explosion(loc, 1, 3, rand(1,5), rand(1,10)) var/list/targets = list() var/cur_y = y - round(row_limit * 0.5, 1) + var/starting_row = 1 + if(cur_y < 1) + starting_row -= cur_y - 1 + cur_y = 1 var/start_x = x - round(column_limit * 0.5, 1) - for(var/row in table) //translate the mines locations into actual turf coordinates. + var/starting_column = 1 + if(start_x < 1) + starting_column -= start_x - 1 + start_x = 1 + for(var/row in start to length(table)) //translate the mines locations into actual turf coordinates. if(!locate(cur_y, start_x, z)) - continue + break var/cur_x = start_x - for(var/column in row) + for(var/column in starting_column to length(table[row])) var/coord_value = table[row][column] if(coord_value == 10 || coord_value == 0) //there is a mine in here. - var/turf/target = locate(cur_y, cur_x, z) - if(!target) - continue - targets += target + var/turf/T = locate(cur_y, cur_x, z) + if(!T) + break + targets += T cur_x++ cur_y++ var/num_explosions = 0 @@ -406,4 +414,4 @@ #undef MINESWEEPER_GAME_MAIN_MENU #undef MINESWEEPER_GAME_PLAYING #undef MINESWEEPER_GAME_LOST -#undef MINESWEEPER_GAME_WON \ No newline at end of file +#undef MINESWEEPER_GAME_WON From e2d2f5a4adfc72856d532f9f7a3f9ba1a70b69ba Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Sat, 4 Apr 2020 14:04:47 +0200 Subject: [PATCH 2/2] Update minesweeper.dm --- code/game/machinery/computer/arcade/minesweeper.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/computer/arcade/minesweeper.dm b/code/game/machinery/computer/arcade/minesweeper.dm index f8639e85c1..370f85b4b9 100644 --- a/code/game/machinery/computer/arcade/minesweeper.dm +++ b/code/game/machinery/computer/arcade/minesweeper.dm @@ -391,7 +391,7 @@ if(start_x < 1) starting_column -= start_x - 1 start_x = 1 - for(var/row in start to length(table)) //translate the mines locations into actual turf coordinates. + for(var/row in starting_row to length(table)) //translate the mines locations into actual turf coordinates. if(!locate(cur_y, start_x, z)) break var/cur_x = start_x