diff --git a/src/ScriptResolving/AngelScript/AngelScriptResolver.hpp b/src/ScriptResolving/AngelScript/AngelScriptResolver.hpp index 4570921..fb593af 100644 --- a/src/ScriptResolving/AngelScript/AngelScriptResolver.hpp +++ b/src/ScriptResolving/AngelScript/AngelScriptResolver.hpp @@ -2,6 +2,7 @@ #define PKMNLIB_ANGELSCRIPTRESOLVER_HPP #include +#include #include "../../../extern/angelscript_addons/scriptbuilder/scriptbuilder.h" #include "../../Battling/Library/BattleLibrary.hpp" #include "AngelScriptEvolutionScript.hpp" @@ -23,6 +24,8 @@ private: ArbUt::Dictionary> _typeDatabase; ArbUt::Dictionary _baseTypes; + std::mutex _baseTypesLock; + ArbUt::Dictionary _itemUseTypes; ArbUt::Dictionary _evolutionTypes; ArbUt::Dictionary _itemUseScripts; @@ -92,6 +95,7 @@ public: asITypeInfo* GetBaseType(const ArbUt::StringView& name) { asITypeInfo* t; + auto lock = std::lock_guard(_baseTypesLock); auto v = _baseTypes.TryGet(name); if (!v.has_value()) { t = _mainModule->GetTypeInfoByName(name.c_str());