From d8c9a19601181ab13f3e123426c9fcbdb866d32c Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 13 Jan 2019 23:58:16 +0100 Subject: [PATCH] Clean up SetAutomapView (#562) --- Source/automap.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Source/automap.cpp b/Source/automap.cpp index 4f788a155..e088e37e7 100644 --- a/Source/automap.cpp +++ b/Source/automap.cpp @@ -578,16 +578,18 @@ void __fastcall SetAutomapView(int x, int y) if (solid) { if (GetAutomapType(xx, yy + 1, FALSE) == 0x4007) automapview[xx][yy + 1] = 1; - } else if (GetAutomapType(xx - 1, yy, FALSE) & 0x4000) + } else if (GetAutomapType(xx - 1, yy, FALSE) & 0x4000) { automapview[xx - 1][yy] = 1; - break; + } + return; case 3: if (solid) { if (GetAutomapType(xx + 1, yy, FALSE) == 0x4007) automapview[xx + 1][yy] = 1; - } else if (GetAutomapType(xx, yy - 1, FALSE) & 0x4000) + } else if (GetAutomapType(xx, yy - 1, FALSE) & 0x4000) { automapview[xx][yy - 1] = 1; - break; + } + return; case 4: if (solid) { if (GetAutomapType(xx, yy + 1, FALSE) == 0x4007) @@ -602,24 +604,27 @@ void __fastcall SetAutomapView(int x, int y) if (GetAutomapType(xx - 1, yy - 1, FALSE) & 0x4000) automapview[xx - 1][yy - 1] = 1; } - break; + return; case 5: if (solid) { if (GetAutomapType(xx, yy - 1, FALSE) & 0x4000) automapview[xx][yy - 1] = 1; if (GetAutomapType(xx, yy + 1, FALSE) == 0x4007) automapview[xx][yy + 1] = 1; - } else if (GetAutomapType(xx - 1, yy, FALSE) & 0x4000) + } else if (GetAutomapType(xx - 1, yy, FALSE) & 0x4000) { automapview[xx - 1][yy] = 1; - break; + } + return; case 6: if (solid) { if (GetAutomapType(xx - 1, yy, FALSE) & 0x4000) automapview[xx - 1][yy] = 1; if (GetAutomapType(xx + 1, yy, FALSE) == 0x4007) automapview[xx + 1][yy] = 1; - } else if (GetAutomapType(xx, yy - 1, FALSE) & 0x4000) + } else if (GetAutomapType(xx, yy - 1, FALSE) & 0x4000) { automapview[xx][yy - 1] = 1; + } + return; } }