projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace sq_newslot with sq_createslot where appropriate (shorter and does the same...
[supertux.git]
/
src
/
supertux
/
savegame.cpp
diff --git
a/src/supertux/savegame.cpp
b/src/supertux/savegame.cpp
index
4119a2d
..
f6f456a
100644
(file)
--- a/
src/supertux/savegame.cpp
+++ b/
src/supertux/savegame.cpp
@@
-17,13
+17,15
@@
#include "supertux/savegame.hpp"
#include "supertux/savegame.hpp"
+#include <algorithm>
+
#include "lisp/lisp.hpp"
#include "lisp/parser.hpp"
#include "lisp/writer.hpp"
#include "physfs/ifile_streambuf.hpp"
#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/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"
#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);
{
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");
}
{
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);
{
// 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);
// 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");
}
{
throw std::runtime_error("Couldn't create state table");
}