Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Commit

Permalink
GRIM: Fix an error with patchr instead of detecting it later
Browse files Browse the repository at this point in the history
  • Loading branch information
klusark committed Apr 10, 2012
1 parent db117c3 commit c9b33fc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
13 changes: 13 additions & 0 deletions dists/engine-data/patches/grim/si.lua.patchr
@@ -0,0 +1,13 @@
PATCHR 1

# In the function si.set_up_actors (line 848), calls "start_script(si.naranja_drinking)",
# which doesn't exist.
# The problem with that is that lua_error ends the function that was going on,
# breaking si.set really badly.

begin 826b0f8e65bf5818ca64a29a37e65c0a 8CC4 #Both v1.0 and v1.01

#Just replace the bad call with NOP
replace 4959 FF FF FF FF FF FF FF FF

end
Binary file modified dists/engine-data/residualvm-grim-patch.lab
Binary file not shown.
8 changes: 1 addition & 7 deletions engines/grim/lua/ltask.cpp
Expand Up @@ -38,13 +38,7 @@ void start_script() {
lua_Type type = ttype(Address(paramObj));

if (paramObj == LUA_NOOBJECT || (type != LUA_T_CPROTO && type != LUA_T_PROTO)) {
warning("lua: Bad argument to start_script. - lua/ltask.cpp:32");
// NOTE: Decomment the lua_error if you want to see the stacktrace.
// It is commented out because si.lua, in the function si.set_up_actors (line 848),
// calls "start_script(si.naranja_drinking)", which doesn't exist. The problem with
// that is that lua_error ends the function that was going on, breaking
// si.set really badly.
// lua_error("Bad argument to start_script");
lua_error("Bad argument to start_script");
return;
}

Expand Down

0 comments on commit c9b33fc

Please sign in to comment.