Skip to content

Commit

Permalink
Merge branch 'mr-142'
Browse files Browse the repository at this point in the history
fix(resources): assign m_rootPath if adhesive isn't loaded (mr-142):
 - 61adf08 fix(resources): assign m_rootPath if adhesive isn't loaded hopefully last edge case i haven't thought about
  • Loading branch information
thorium-cfx committed Nov 6, 2023
2 parents 29e01c1 + 61adf08 commit 47f8999
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions code/components/citizen-resources-core/src/Resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@

#if __has_include(<InternalResourceImpl.h>) && !defined(IS_FXSERVER)
#include <InternalResourceImpl.h>

inline bool IsAdhesiveLoaded()
{
static HMODULE s_adhesiveHandle = GetModuleHandle(L"adhesive.dll");
return s_adhesiveHandle != NULL;
}

#else
#define INTERNAL_RESOURCE_GET_NAME GetName
#endif
Expand Down Expand Up @@ -54,6 +61,11 @@ bool ResourceImpl::LoadFrom(const std::string& rootPath, std::string* errorState

#if !defined(INTERNAL_RESOURCE_IMPL)
m_rootPath = rootPath;
#else
if (!IsAdhesiveLoaded())
{
m_rootPath = rootPath;
}
#endif

m_state = ResourceState::Stopped;
Expand Down

0 comments on commit 47f8999

Please sign in to comment.