Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/base/faction.h20
-rw-r--r--src/game/base/savegame.cc2
2 files changed, 21 insertions, 1 deletions
diff --git a/src/game/base/faction.h b/src/game/base/faction.h
index 3f6a1e5..551ce7b 100644
--- a/src/game/base/faction.h
+++ b/src/game/base/faction.h
@@ -84,6 +84,9 @@ public:
*/
static bool init();
+ /**
+ * @brief cleanup routines
+ */
static void done();
/**
@@ -91,6 +94,9 @@ public:
*/
static void list();
+ /**
+ * @brief returns a pointer to the faction with the given label, returns 0 if not found.
+ * */
static Faction *find(const std::string & label);
/**
@@ -98,11 +104,23 @@ public:
* */
static void apply_default(core::Reputation & reputation);
-
+ /**
+ * @brief faction info type
+ * */
static inline const core::InfoType *infotype() {
return faction_infotype;
}
+ /**
+ * @brief default faction
+ * This faction represents the default player reputation.
+ * No ships should be a member of this faction, not even player ships.
+ * */
+ static inline const Faction *default_faction()
+ {
+ return faction_default;
+ }
+
private:
/* --- attributes ------------------------------------------------- */
diff --git a/src/game/base/savegame.cc b/src/game/base/savegame.cc
index 90b7956..28f0ddb 100644
--- a/src/game/base/savegame.cc
+++ b/src/game/base/savegame.cc
@@ -99,6 +99,8 @@ void SaveGame::load_game(core::Player *player, filesystem::IniFile & inifile)
} else if (inifile.got_key_float("reputation", reputation)) {
if (!faction) {
inifile.unknown_error("reputation without faction");
+ } else if (faction == Faction::default_faction()) {
+ inifile.unknown_error("ignoring reputation for default faction");
} else {
player->reputation().set_reputation(faction, reputation);
}