From 4da83410245bffef0f7d71ff8d056dd3fb2e1357 Mon Sep 17 00:00:00 2001 From: Andrii Danylchenko Date: Fri, 17 Sep 2021 10:18:39 +0300 Subject: [PATCH] Android: allow run without scripting --- lib/ScriptHandler.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/ScriptHandler.cpp b/lib/ScriptHandler.cpp index 6536d2d7f..ebca5ce26 100644 --- a/lib/ScriptHandler.cpp +++ b/lib/ScriptHandler.cpp @@ -182,12 +182,21 @@ void PoolImpl::serializeState(const bool saving, JsonNode & data) } ScriptHandler::ScriptHandler() + :erm(nullptr), lua(nullptr) { boost::filesystem::path filePath = VCMIDirs::get().fullLibraryPath("scripting", "vcmiERM"); - erm = CDynLibHandler::getNewScriptingModule(filePath); + + if (boost::filesystem::exists(filePath)) + { + erm = CDynLibHandler::getNewScriptingModule(filePath); + } filePath = VCMIDirs::get().fullLibraryPath("scripting", "vcmiLua"); - lua = CDynLibHandler::getNewScriptingModule(filePath); + + if (boost::filesystem::exists(filePath)) + { + lua = CDynLibHandler::getNewScriptingModule(filePath); + } } ScriptHandler::~ScriptHandler() = default;