[Scummvm-git-logs] scummvm master -> 0063c43a3d9d2bb3125b124e22aea7669ac19903

mduggan noreply at scummvm.org
Tue Feb 28 22:52:38 UTC 2023


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

Summary:
a87d8e7644 TETRAEDGE: Add more lua debugging ability
0063c43a3d TETRAEDGE: Work around a Syberia 2 script bug


Commit: a87d8e76447ebe77a2711e4aaf09946e4761152d
    https://github.com/scummvm/scummvm/commit/a87d8e76447ebe77a2711e4aaf09946e4761152d
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-03-01T07:51:28+09:00

Commit Message:
TETRAEDGE: Add more lua debugging ability

Changed paths:
    engines/tetraedge/te/te_lua_context.cpp


diff --git a/engines/tetraedge/te/te_lua_context.cpp b/engines/tetraedge/te/te_lua_context.cpp
index 79099977723..d57711d0719 100644
--- a/engines/tetraedge/te/te_lua_context.cpp
+++ b/engines/tetraedge/te/te_lua_context.cpp
@@ -29,6 +29,8 @@
 
 namespace Tetraedge {
 
+//#define TETRAEDGE_LUA_DEBUG 1
+
 //static lua_State *globalState = nullptr;
 
 static int luaPanicFunction(lua_State *state) {
@@ -38,6 +40,15 @@ static int luaPanicFunction(lua_State *state) {
 	return 1;
 }
 
+#ifdef TETRAEDGE_LUA_DEBUG
+static void luaDebugHook(lua_State *L, lua_Debug *ar) {
+    if (!lua_getinfo(L, "Sn", ar))
+        return;
+    debug("LUA: %s %d", ar->source, ar->currentline);
+}
+#endif
+
+
 TeLuaContext::TeLuaContext() : _luaState(nullptr) {
 	_luaState = lua_open();
 	luaL_openlibs(_luaState);
@@ -56,6 +67,9 @@ void TeLuaContext::create() {
 	_luaState = lua_open();
 	luaL_openlibs(_luaState);
 	lua_atpanic(_luaState, luaPanicFunction);
+#ifdef TETRAEDGE_LUA_DEBUG
+	lua_sethook(_luaState, luaDebugHook, LUA_MASKCALL | LUA_MASKLINE, 0);
+#endif
 }
 
 void TeLuaContext::destroy() {


Commit: 0063c43a3d9d2bb3125b124e22aea7669ac19903
    https://github.com/scummvm/scummvm/commit/0063c43a3d9d2bb3125b124e22aea7669ac19903
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-03-01T07:51:28+09:00

Commit Message:
TETRAEDGE: Work around a Syberia 2 script bug

Changed paths:
    engines/tetraedge/te/te_lua_thread.cpp


diff --git a/engines/tetraedge/te/te_lua_thread.cpp b/engines/tetraedge/te/te_lua_thread.cpp
index fd204eb376f..ec4fa047f9f 100644
--- a/engines/tetraedge/te/te_lua_thread.cpp
+++ b/engines/tetraedge/te/te_lua_thread.cpp
@@ -197,6 +197,19 @@ void TeLuaThread::executeFile(const Common::FSNode &node) {
 		fixline = strstr(fixline, RESEED_PATTERN);
 	}
 
+	//
+	// WORKAROUND: Syberia 2 A1_Cabaret/11420/Logic11420.lua has a typo on a
+	// variable name that causes the game to lock up
+	//
+	fixline = strstr(buf, "OBJECT_10050_Inventory_obj_coeurmec_Taketoun ");
+	if (fixline) {
+		// Taketoun -> Taken
+		fixline[40] = 'n';
+		fixline[41] = ' ';
+		fixline[42] = ' ';
+		fixline[43] = ' ';
+	}
+
 	_lastResumeResult = luaL_loadbuffer(_luaThread, buf, fileLen, node.getPath().c_str());
 	if (_lastResumeResult) {
 		const char *msg = lua_tostring(_luaThread, -1);




More information about the Scummvm-git-logs mailing list