Warn only once per missing icon

Mods may dynamically request icons
(e.g., [icon=\"emblem_${civ}\"], [icon=\"icon_${res}\"]) that
don't exist when another mod introduced the new civ or resource
but hasn't added that icon.
This results in excessive error log spam during normal gameplay.
This commit is contained in:
Atrik 2026-03-26 22:25:34 +01:00
parent 7ed3e6b059
commit 30b4ea8fca

View file

@ -113,7 +113,7 @@ void CGUIString::GenerateTextCall(const CGUI& pGUI, SFeedback& Feedback, CStrInt
if (!pGUI.HasIcon(path))
{
if (pObject)
LOGERROR("Trying to use an icon, imgleft or imgright-tag with an undefined icon (\"%s\").", path.c_str());
ONCE_EACH(path, LOGWARNING("Trying to use an icon, imgleft or imgright-tag with an undefined icon (\"%s\").", key));
continue;
}