From 8ddde4466dc78bae798a6e716148cc47cf60d8af Mon Sep 17 00:00:00 2001 From: Zero Fanker Date: Mon, 4 Nov 2024 21:59:56 -0500 Subject: [PATCH] fixed infantry subposition count error, and corrected loopup table orders. (#108) --- MissionEditor/Defines.h | 2 +- MissionEditor/IsoView.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/MissionEditor/Defines.h b/MissionEditor/Defines.h index 28fb5cd..0566494 100644 --- a/MissionEditor/Defines.h +++ b/MissionEditor/Defines.h @@ -62,7 +62,7 @@ #define PICDATA_TYPE_SHP 1 #define PICDATA_TYPE_VXL 2 -#define SUBPOS_COUNT 3 +#define SUBPOS_COUNT 4 #define REAL_SUBPOS_COUNT 3 #define SOUND_NONE 0 diff --git a/MissionEditor/IsoView.cpp b/MissionEditor/IsoView.cpp index 01899a6..b86a914 100644 --- a/MissionEditor/IsoView.cpp +++ b/MissionEditor/IsoView.cpp @@ -6002,8 +6002,14 @@ void CIsoView::DrawMap() DrawCell(drawCoords.x, drawCoords.y, 1, 1, c); #endif - static const ProjectedVec subPosLookup[5] = { ProjectedVec(0, -f_y / 4), ProjectedVec(f_x / 4 , 0), ProjectedVec(-f_x / 4, 0), ProjectedVec(0, f_y / 4), ProjectedVec() }; - auto drawCoordsInf = drawCoords + subPosLookup[ic > 4 ? 4 : ic]; + static const ProjectedVec subPosLookup[5] = { + ProjectedVec(), + ProjectedVec(f_x / 4 , 0), + ProjectedVec(-f_x / 4, 0), + ProjectedVec(0, f_y / 4), + ProjectedVec(0, -f_y / 4), + }; + auto drawCoordsInf = drawCoords + subPosLookup[std::min(ic, 4)]; PICDATA p;