From 874c85f8a009a1c16a85b439c2dccfb04e3371f9 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 28 Feb 2015 22:27:17 +0000 Subject: Added abandon engine function to drop the current character. --- src/game/base/savegame.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/game/base/savegame.cc') 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; -- cgit v1.2.3