X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fsupertux%2Fsavegame.cpp;h=f6f456a03fc1b6fd84b3334e80a31a5f9c2af5e8;hb=05d168f5e5bbd46e44b1b1ad857d2d8c59b230c1;hp=4119a2dd4bc07d6430ca08968ae5f0714fc6fa85;hpb=55ee761513b8dabfc26ed31bca634afabe368e11;p=supertux.git diff --git a/src/supertux/savegame.cpp b/src/supertux/savegame.cpp index 4119a2dd4..f6f456a03 100644 --- a/src/supertux/savegame.cpp +++ b/src/supertux/savegame.cpp @@ -17,13 +17,15 @@ #include "supertux/savegame.hpp" +#include + #include "lisp/lisp.hpp" #include "lisp/parser.hpp" #include "lisp/writer.hpp" #include "physfs/ifile_streambuf.hpp" +#include "scripting/scripting.hpp" #include "scripting/serialize.hpp" #include "scripting/squirrel_util.hpp" -#include "scripting/squirrel_util.hpp" #include "supertux/player_status.hpp" #include "util/file_system.hpp" #include "util/log.hpp" @@ -51,7 +53,7 @@ void get_or_create_table_entry(HSQUIRRELVM vm, const std::string& name) { sq_pushstring(vm, name.c_str(), -1); sq_newtable(vm); - if(SQ_FAILED(sq_newslot(vm, -3, SQFalse))) + if(SQ_FAILED(sq_createslot(vm, -3))) { throw std::runtime_error("failed to create '" + name + "' table entry"); } @@ -256,16 +258,10 @@ Savegame::clear_state_table() // delete existing state table, if it exists sq_pushroottable(vm); { - /*sq_pushstring(vm, "state", -1); - if(SQ_FAILED(sq_deleteslot(vm, -2, SQFalse))) - { - sq_pop(vm, 1); - }*/ - // create a new empty state table sq_pushstring(vm, "state", -1); sq_newtable(vm); - if(SQ_FAILED(sq_newslot(vm, -3, SQFalse))) + if(SQ_FAILED(sq_createslot(vm, -3))) { throw std::runtime_error("Couldn't create state table"); }