From 6955c2c69f47a9147923f150b2df960d0ce3008b Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 18 Apr 2020 16:04:48 +0200 Subject: [PATCH] Ensure AngelScript allows resolving PkmnScriptCategory categories. --- src/ScriptResolving/AngelScript/AngelScripResolver.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ScriptResolving/AngelScript/AngelScripResolver.cpp b/src/ScriptResolving/AngelScript/AngelScripResolver.cpp index bf7009d..9be2811 100644 --- a/src/ScriptResolving/AngelScript/AngelScripResolver.cpp +++ b/src/ScriptResolving/AngelScript/AngelScripResolver.cpp @@ -5,6 +5,7 @@ #include "../../../extern/angelscript_addons/scripthandle/scripthandle.h" #include "../../../extern/angelscript_addons/scripthelper/scripthelper.h" #include "../../../extern/angelscript_addons/scriptstdstring/scriptstdstring.h" +#include "../../Battling/PkmnScriptCategory.hpp" #include "ByteCodeHandling/FileByteCodeStream.hpp" #include "ByteCodeHandling/MemoryByteCodeStream.hpp" #include "TypeRegistry/BasicScriptClass.hpp" @@ -43,6 +44,9 @@ void AngelScripResolver::Initialize(CreatureLib::Battling::BattleLibrary* arg) { for (auto scriptCategory : ScriptCategoryHelper::GetValues()) { _typeDatabase.Insert(scriptCategory, {}); } + for (auto scriptCategory : PkmnScriptCategoryHelper::GetValues()) { + _typeDatabase.Insert(static_cast(scriptCategory), {}); + } auto library = (PkmnLib::Battling::BattleLibrary*)arg; _engine = asCreateScriptEngine(); @@ -186,6 +190,9 @@ void AngelScripResolver::FinalizeModule() { } else if (metadataKind == "Side") { _typeDatabase[ScriptCategory::Side].Insert(effectName, new AngelScriptTypeInfo(effectName, typeInfo)); + } else if (metadataKind == "Weather") { + _typeDatabase[static_cast(PkmnScriptCategory::Weather)].Insert(effectName, + new AngelScriptTypeInfo(effectName, typeInfo)); } } }