diff options
author | Stijn Buys <ingar@osirion.org> | 2013-03-02 11:21:08 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-03-02 11:21:08 +0000 |
commit | 025a4defa7cc1ad42c86fe9e1b49d1cb6fa45737 (patch) | |
tree | f4b4dd13aeb3f38fd14c33e42fb5f22e08fdecbe /src/game/base | |
parent | 98699db58a16f0831de66fe86302ebd1b1cb5507 (diff) |
Corrected line number in a loadgame error message.
Diffstat (limited to 'src/game/base')
-rw-r--r-- | src/game/base/savegame.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/game/base/savegame.cc b/src/game/base/savegame.cc index ca911ec..789bdb1 100644 --- a/src/game/base/savegame.cc +++ b/src/game/base/savegame.cc @@ -152,13 +152,17 @@ void SaveGame::load_game(core::Player *player, filesystem::IniFile & inifile) } else if (inifile.in_section("item")) { if (inifile.got_key_label("type", itemtype)) { - continue; + core::InfoType *item_infotype = core::InfoType::find(itemtype); + if (!itemtype.size() || !item_infotype) { + inifile.unknown_error("invalid item type '" + itemtype +"'"); + continue; + } } else if (inifile.got_key_label("label", itemlabel)) { if (!item && ship) { core::InfoType *item_infotype = core::InfoType::find(itemtype); if (!itemtype.size() || !item_infotype) { - inifile.unknown_error("invalid item type '" + itemtype +"'"); + // inifile.unknown_error("invalid item type '" + itemtype +"'"); continue; } @@ -167,6 +171,7 @@ void SaveGame::load_game(core::Player *player, filesystem::IniFile & inifile) inifile.unknown_error("invalid item label '" + itemlabel +"'"); continue; } + item = new core::Item(item_info); ship->inventory()->add(item); } |