fix: fixed commit 55e20b3, which causes new issues on units with Image=ID set in rules .

This commit is contained in:
Zero Fanker 2024-11-18 19:15:35 -05:00
parent d829b8e9ee
commit f7e8dd2249

View file

@ -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)) {