Changeset - 55916cd3c1a0
[Not reviewed]
default
0 2 0
Silverwing - 4 years ago 2020-05-07 15:50:34

fix: warehouse32 fixed
2 files changed with 30 insertions and 1 deletions:
0 comments (0 inline, 0 general)
startup.lua
Show inline comments
 
global {
 
    version = '0.10.0';
 
    warehouse18_found = false;
 
    warehouse32_found = false;
 
    warehouse32_visited = false;
 
@@ -215,7 +216,35 @@ function prepare_ending(nstate)
 
    end;
 
end
 

	
 
function fix_save(filename)
 
    local f=stead.io.open(filename,"rb");
 
    if f~=nil then
 
        local content = f:read("*all");
 
        stead.io.close(f);
 
        print(string.find(content, '0.10.0'));
 
        if string.find(content, '0.10.0') == nil then
 
            print("Fixing save file");
 
            content = stead.string.gsub(content, '([^A-Za-z])rm([^A-Za-z])', '%1warehouse_32%2') .. '\nversion="0.10.0"\n';
 
            print(content)
 
            local f=stead.io.open(filename,"wb")
 
            if f ~= nil then
 
                f:write(content);
 
                stead.io.close(f);
 
            else
 
                print("Fixing save file failed");
 
            end;
 
        end;
 
    end;
 
end;
 

	
 
function init()
 
    ---save fix
 
    fix_save(instead_savepath() .. '/autosave');
 
    fix_save(instead_savepath() .. '/save1');
 
    fix_save(instead_savepath() .. '/save2');
 
    fix_save(instead_savepath() .. '/save3');
 
    fix_save(instead_savepath() .. '/save4');
 
    fix_save(instead_savepath() .. '/save5');
 
    ---modules init
 
    pl = player_drake;
 
    --putf("debug_tool", stead.me())
warehouse32.lua
Show inline comments
 
@@ -492,7 +492,7 @@ warehouse_32 = stealthroom {
 
	};
 
};
 
 
rm = warehouse_32;
 
rm = 'warehouse_32';
 
 
warehouse_32_shelves = obj {
 
    var {
0 comments (0 inline, 0 general)