Make CreateScript use std::string to help prevent issues.
continuous-integration/drone/push Build is passing

This commit is contained in:
Deukhoofd committed 2022-03-20 11:18:32 +01:00
1 parent 3bd5bb3fe6
commit e346f5ffb4
2 files changed
+3 -3

No files matched your search

@@ -320,8 +320,8 @@ void AngelScriptResolver::RegisterScriptType(asITypeInfo* typeInfo, const ArbUt:
break;
}
}
void AngelScriptResolver::CreateScript(const char* name, const char* script) {
EnsureGreater(_builder.AddSectionFromMemory(name, script), 0);
void AngelScriptResolver::CreateScript(const std::string& name, const std::string& script) {
EnsureGreater(_builder.AddSectionFromMemory(name.c_str(), script.c_str()), 0);
}
void AngelScriptResolver::WriteByteCodeToFile(const char* file, bool stripDebugInfo) {
FILE* wFile = nullptr;
@@ -58,7 +58,7 @@ public:
void Initialize(CreatureLib::Battling::BattleLibrary* library) override { Initialize(library, true); }
void Initialize(CreatureLib::Battling::BattleLibrary* library, bool includeStandard);
void CreateScript(const char* name, const char* script);
void CreateScript(const std::string& name, const std::string& script);
inline void SetSourceDirectory(std::string const& path) noexcept { _sourceDirectory = path; }
const asIScriptModule* GetMainModule() const noexcept { return _mainModule; }
CScriptBuilder& GetBuilder() noexcept { return _builder; }