diff --git a/src/ScriptResolving/AngelScript/AngelScriptResolver.cpp b/src/ScriptResolving/AngelScript/AngelScriptResolver.cpp index c3400ff..617805f 100644 --- a/src/ScriptResolving/AngelScript/AngelScriptResolver.cpp +++ b/src/ScriptResolving/AngelScript/AngelScriptResolver.cpp @@ -81,6 +81,9 @@ void AngelScriptResolver::Initialize(CreatureLib::Battling::BattleLibrary* arg, r = _engine->RegisterGlobalFunction("void print(const string &in)", asFUNCTION(Print), asCALL_CDECL); if (r < 0) throw ArbUt::Exception("Registering print function failed."); + r = _engine->RegisterGlobalFunction("void print(const constString &in)", asFUNCTION(PrintConst), asCALL_CDECL); + if (r < 0) + throw ArbUt::Exception("Registering print function failed."); } _builder.StartNewModule(_engine, "pkmn"); diff --git a/src/ScriptResolving/AngelScript/AngelScriptResolver.hpp b/src/ScriptResolving/AngelScript/AngelScriptResolver.hpp index 7f8c4d3..d01b179 100644 --- a/src/ScriptResolving/AngelScript/AngelScriptResolver.hpp +++ b/src/ScriptResolving/AngelScript/AngelScriptResolver.hpp @@ -21,6 +21,7 @@ private: static void MessageCallback(const asSMessageInfo* msg, void* param); static void Print(const std::string& str) { std::cout << str << std::endl; } + static void PrintConst(const ArbUt::StringView& str) { Print(std::string(str.std_str())); } ArbUt::Dictionary> _typeDatabase; ArbUt::Dictionary _baseTypes; ArbUt::Dictionary _itemUseTypes;