Merge pull request #8033 from bencie/bg-entities-no-extension

Let users pick background entities map without file extensions
This commit is contained in:
Robert Müller 2024-02-29 17:55:13 +00:00 committed by GitHub
commit 16feff41de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -60,7 +60,7 @@ void CBackground::LoadBackground()
bool NeedImageLoading = false;
char aBuf[IO_MAX_PATH_LENGTH];
str_format(aBuf, sizeof(aBuf), "maps/%s", g_Config.m_ClBackgroundEntities);
str_format(aBuf, sizeof(aBuf), "maps/%s%s", g_Config.m_ClBackgroundEntities, str_endswith(g_Config.m_ClBackgroundEntities, ".map") ? "" : ".map");
if(str_comp(g_Config.m_ClBackgroundEntities, CURRENT_MAP) == 0)
{
m_pMap = Kernel()->RequestInterface<IEngineMap>();