瀏覽代碼

Android: allow run without scripting

Andrii Danylchenko 4 年之前
父節點
當前提交
4da8341024
共有 1 個文件被更改,包括 11 次插入2 次删除
  1. 11 2
      lib/ScriptHandler.cpp

+ 11 - 2
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;