From 51cc17b67fa8813ad8cedae0f2584d25deaa38ae Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 19 Jan 2013 23:08:14 +0000 Subject: Do not print an error message if a savegame has no spawn set. --- src/game/base/savegame.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/base/savegame.cc b/src/game/base/savegame.cc index 616b85f..ca911ec 100644 --- a/src/game/base/savegame.cc +++ b/src/game/base/savegame.cc @@ -105,7 +105,9 @@ void SaveGame::load_game(core::Player *player, filesystem::IniFile & inifile) continue; } else if (inifile.got_key_string("spawn", str)) { - if (str.size() < 3) { + if (!str.size()) { + continue; + } else if (str.size() < 3) { inifile.unknown_error("spawn with invalid label '" + str + "'"); continue; } @@ -237,7 +239,9 @@ void SaveGame::load_game(core::Player *player, filesystem::IniFile & inifile) if (!zone) { zone = Default::zone; } - + if (!ship->spawn()) { + ship->set_spawn(zone->default_view()); + } if (!ship->spawn()) { ship->set_spawn(Default::view); } -- cgit v1.2.3