From f7e8dd22492121f7b02ddc34ace6ac0156fdaafb Mon Sep 17 00:00:00 2001 From: Zero Fanker Date: Mon, 18 Nov 2024 19:15:35 -0500 Subject: [PATCH] fix: fixed commit 55e20b3, which causes new issues on units with Image=ID set in rules . --- MissionEditor/inlines.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/MissionEditor/inlines.h b/MissionEditor/inlines.h index 6191c63..5fc9856 100644 --- a/MissionEditor/inlines.h +++ b/MissionEditor/inlines.h @@ -50,7 +50,7 @@ inline BOOL isFalse(CString expr) // retrieve the picture filename of a unit (as it is saved in the pics map). The returned file may not exist in the pics map (you need to do a check!). -inline CString GetUnitPictureFilename(const CString& lpUnitName, DWORD dwPicIndex) +inline CString GetUnitPictureFilename(const CString& artSectionId, DWORD dwPicIndex) { CIniFile& ini = Map->GetIniFile(); @@ -59,14 +59,11 @@ inline CString GetUnitPictureFilename(const CString& lpUnitName, DWORD dwPicInde // store differently for each type even they shares same image, // because they can have different components, e.g. turret image - if (pics.find(lpUnitName + n) != pics.end()) { - return lpUnitName + n; + if (pics.find(artSectionId + n) != pics.end()) { + return artSectionId + n; } - - auto artname = rules.GetStringOr(lpUnitName, "Image", lpUnitName); - artname = ini.GetStringOr(lpUnitName, "Image", artname); - - auto const& shapeName = art.GetString(artname, "Image"); + auto artname = artSectionId; + auto const& shapeName = art.GetString(artSectionId, "Image"); if (!shapeName.IsEmpty()) { if (!g_data.GetBool("IgnoreArtImage", artname)) {