[Scummvm-git-logs] scummvm master -> 7e462a24fbf7cab56e065702d508c500a843a96e

OMGPizzaGuy noreply at scummvm.org
Sat Aug 3 13:17:19 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7e462a24fb ULTIMA: NUVIE: Fix loading lua scripts on Windows


Commit: 7e462a24fbf7cab56e065702d508c500a843a96e
    https://github.com/scummvm/scummvm/commit/7e462a24fbf7cab56e065702d508c500a843a96e
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2024-08-03T08:17:16-05:00

Commit Message:
ULTIMA: NUVIE: Fix loading lua scripts on Windows

LUA seems to expect a "/" (POSIX) path separator, so using Common::Path::kNativeSeparator made engine unable to find the lua scripts on Windows

Changed paths:
    engines/ultima/nuvie/script/script.cpp


diff --git a/engines/ultima/nuvie/script/script.cpp b/engines/ultima/nuvie/script/script.cpp
index 82e34642842..6295f7e3b4d 100644
--- a/engines/ultima/nuvie/script/script.cpp
+++ b/engines/ultima/nuvie/script/script.cpp
@@ -904,7 +904,7 @@ bool Script::init() {
 
 	if (run_script(init_str.c_str()) == false) {
 		Std::string errorStr = "Loading ";
-		errorStr.append(path.toString());
+		errorStr.append(path.toString('/'));
 		ConsoleAddError(errorStr);
 		return false;
 	}
@@ -1399,12 +1399,12 @@ bool Script::run_lua_file(const char *filename) {
 	dir = path;
 	build_path(dir, filename, path);
 
-	if (luaL_loadfile(L, path.toString(Common::Path::kNativeSeparator).c_str()) != 0) {
-		DEBUG(0, LEVEL_ERROR, "loading script file %s", path.toString(Common::Path::kNativeSeparator).c_str());
+	if (luaL_loadfile(L, path.toString('/').c_str()) != 0) {
+		DEBUG(0, LEVEL_ERROR, "loading script file %s", path.toString('/').c_str());
 		return false;
 	}
 
-	return call_function(path.toString(Common::Path::kNativeSeparator).c_str(), 0, 0);
+	return call_function(path.toString('/').c_str(), 0, 0);
 }
 
 bool Script::call_moonstone_set_loc(uint8 phase, MapCoord location) {
@@ -2365,7 +2365,7 @@ static int nscript_load(lua_State *L) {
 	dir = path;
 	build_path(dir, file, path);
 
-	if (luaL_loadfile(L, path.toString(Common::Path::kNativeSeparator).c_str()) == LUA_ERRFILE) {
+	if (luaL_loadfile(L, path.toString('/').c_str()) == LUA_ERRFILE) {
 		lua_pop(L, 1);
 		return 0;
 	}




More information about the Scummvm-git-logs mailing list