From 4b8bdc5c7783ac549fb07ce3455c8632b12bd297 Mon Sep 17 00:00:00 2001 From: Guntran <15348869+GuntranHoet@users.noreply.github.com> Date: Mon, 13 Apr 2020 15:04:23 +0100 Subject: [PATCH] Fixed map drawing bug. This would otherwise have looked messed up if the map width and height weren't equal values. --- OneLoneCoder_ComandLineFPS_2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OneLoneCoder_ComandLineFPS_2.cpp b/OneLoneCoder_ComandLineFPS_2.cpp index dc45cd8..5909a28 100644 --- a/OneLoneCoder_ComandLineFPS_2.cpp +++ b/OneLoneCoder_ComandLineFPS_2.cpp @@ -374,7 +374,7 @@ class OneLoneCoder_UltimateFPS : public olcConsoleGameEngine // Display Map & Player for (int nx = 0; nx < nMapWidth; nx++) - for (int ny = 0; ny < nMapWidth; ny++) + for (int ny = 0; ny < nMapHeight; ny++) Draw(nx+1, ny+1, map[ny * nMapWidth + nx]); Draw(1 + (int)fPlayerY, 1 + (int)fPlayerX, L'P');