Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/base/savegame.cc')
-rw-r--r--src/game/base/savegame.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/game/base/savegame.cc b/src/game/base/savegame.cc
index ab2ecc2..8542a00 100644
--- a/src/game/base/savegame.cc
+++ b/src/game/base/savegame.cc
@@ -124,6 +124,9 @@ void SaveGame::load_game(core::Player *player, filesystem::IniFile & inifile)
continue;
} else if (inifile.got_key_label("zone", str)) {
+ if (!ship) {
+ continue;
+ }
zone = core::Zone::find(str);
continue;
@@ -143,6 +146,9 @@ void SaveGame::load_game(core::Player *player, filesystem::IniFile & inifile)
continue;
} else if (inifile.got_key_string("spawn", str)) {
+ if (!ship) {
+ continue;
+ }
if (!str.size()) {
continue;
} else if (str.size() < 3) {
@@ -189,6 +195,11 @@ void SaveGame::load_game(core::Player *player, filesystem::IniFile & inifile)
} else if (inifile.in_section("item")) {
+ if (!ship)
+ {
+ continue;
+ }
+
if (inifile.got_key_label("type", itemtype)) {
core::InfoType *item_infotype = core::InfoType::find(itemtype);
if (!itemtype.size() || !item_infotype) {
@@ -327,7 +338,8 @@ void SaveGame::player_to_stream(core::Player *player, std::ostream & os)
os << std::endl;
// player reputation
- for (core::Reputation::FactionReps::const_iterator it = player->reputation().factionreps().begin(); it != player->reputation().factionreps().end(); ++it) {
+ for (core::Reputation::FactionReps::const_iterator it = player->reputation().factionreps().begin(); it != player->reputation().factionreps().end(); ++it)
+ {
os << "[reputation]" << std::endl;
os << "faction=" << (*it)->faction()->label() << std::endl;
os << "reputation=" << (*it)->reputation() << std::endl;