mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Engine: use CThreadMutex for installed maps global
Use the type used by the engine instead of STD.
This commit is contained in:
parent
93eb3ab3a3
commit
1e667c8f30
@ -122,7 +122,7 @@ void Mod_GetAllInstalledMaps()
|
|||||||
AddFilesToList(fileList, "vpk", "vpk", nullptr, '/');
|
AddFilesToList(fileList, "vpk", "vpk", nullptr, '/');
|
||||||
|
|
||||||
std::cmatch regexMatches;
|
std::cmatch regexMatches;
|
||||||
std::lock_guard<std::mutex> l(g_InstalledMapsMutex);
|
AUTO_LOCK(g_InstalledMapsMutex);
|
||||||
|
|
||||||
g_InstalledMaps.Purge(); // Clear current list.
|
g_InstalledMaps.Purge(); // Clear current list.
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ inline bool* g_pPakPrecacheJobFinished;
|
|||||||
inline void(*Mod_UnloadPendingAndPrecacheRequestedPaks)(void);
|
inline void(*Mod_UnloadPendingAndPrecacheRequestedPaks)(void);
|
||||||
|
|
||||||
extern CUtlVector<CUtlString> g_InstalledMaps;
|
extern CUtlVector<CUtlString> g_InstalledMaps;
|
||||||
extern std::mutex g_InstalledMapsMutex;
|
extern CThreadMutex g_InstalledMapsMutex;
|
||||||
|
|
||||||
bool Mod_LevelHasChanged(const char* pszLevelName);
|
bool Mod_LevelHasChanged(const char* pszLevelName);
|
||||||
void Mod_GetAllInstalledMaps();
|
void Mod_GetAllInstalledMaps();
|
||||||
|
@ -36,7 +36,7 @@ namespace VScriptCode
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
SQRESULT GetAvailableMaps(HSQUIRRELVM v)
|
SQRESULT GetAvailableMaps(HSQUIRRELVM v)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> l(g_InstalledMapsMutex);
|
AUTO_LOCK(g_InstalledMapsMutex);
|
||||||
|
|
||||||
if (g_InstalledMaps.IsEmpty())
|
if (g_InstalledMaps.IsEmpty())
|
||||||
SCRIPT_CHECK_AND_RETURN(v, SQ_OK);
|
SCRIPT_CHECK_AND_RETURN(v, SQ_OK);
|
||||||
|
@ -545,7 +545,7 @@ void CBrowser::DrawHostPanel(void)
|
|||||||
|
|
||||||
if (ImGui::BeginCombo("Map", details.map.c_str()))
|
if (ImGui::BeginCombo("Map", details.map.c_str()))
|
||||||
{
|
{
|
||||||
g_InstalledMapsMutex.lock();
|
g_InstalledMapsMutex.Lock();
|
||||||
|
|
||||||
FOR_EACH_VEC(g_InstalledMaps, i)
|
FOR_EACH_VEC(g_InstalledMaps, i)
|
||||||
{
|
{
|
||||||
@ -558,7 +558,7 @@ void CBrowser::DrawHostPanel(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_InstalledMapsMutex.unlock();
|
g_InstalledMapsMutex.Unlock();
|
||||||
ImGui::EndCombo();
|
ImGui::EndCombo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,4 +19,4 @@ void VKeyValues::Detour(const bool bAttach) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
std::mutex g_InstalledMapsMutex;
|
CThreadMutex g_InstalledMapsMutex;
|
Loading…
x
Reference in New Issue
Block a user