Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2013-03-02 11:21:08 +0000
committerStijn Buys <ingar@osirion.org>2013-03-02 11:21:08 +0000
commit025a4defa7cc1ad42c86fe9e1b49d1cb6fa45737 (patch)
treef4b4dd13aeb3f38fd14c33e42fb5f22e08fdecbe /src
parent98699db58a16f0831de66fe86302ebd1b1cb5507 (diff)
Corrected line number in a loadgame error message.
Diffstat (limited to 'src')
-rw-r--r--src/game/base/savegame.cc9
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);
}