소스 검색

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;