Clean up Engine.GetGUIObjectByName calls

GetGUIObjectByName was previously made stricter, logging an
error if it doesn't find the target object.
This commit deals with the resulting error-causing (invalid) calls,
by deleting them if they're unnecessary or converting them to the new
TryGetGUIObjectByName (which doesn't log any errors).
This commit is contained in:
Vantha
2025-07-30 20:53:18 +02:00
committed by Ralph Sennhauser
parent 6515c3fb1f
commit 2026a5fece
3 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -448,7 +448,7 @@ IGUIObject* CGUI::FindObjectByName(const CStr& Name) const
{
IGUIObject* obj = TryFindObjectByName(Name);
if (obj == nullptr)
LOGERROR("Failed to get GUI object by name: object '%s' not found.\nNote: Use 'Engine.TryGetGUIObjectByName' to query for potentially non-existent objects instead.", Name);
LOGERROR("Failed to get GUI object by name: object '%s' not found. Note: Use 'Engine.TryGetGUIObjectByName' to query for potentially non-existent objects instead.", Name);
return obj;
}