- if (access(slotfile.c_str(), F_OK) == 0)
- {
- if (!title.empty())
- tmp = "Slot " + stream.str() + " - " + title;
- else
- tmp = "Slot " + stream.str() + " - Savegame";
- }
- else
- tmp = std::string(_("Slot")) + " " + stream.str() + " - " + std::string(_("Free"));
+ const lisp::Lisp* savegame = root->get_lisp("supertux-savegame");
+ if(!savegame)
+ throw std::runtime_error("file is not a supertux-savegame.");
+
+ savegame->get("title", title);
+ } catch(std::exception& e) {
+ return std::string(_("Slot")) + " " + stream.str() + " - " +
+ std::string(_("Free"));
+ }