Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/base/faction.cc')
-rw-r--r--src/game/base/faction.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/game/base/faction.cc b/src/game/base/faction.cc
index 73e5140..8171a2d 100644
--- a/src/game/base/faction.cc
+++ b/src/game/base/faction.cc
@@ -208,4 +208,18 @@ void Faction::apply(core::Entity *entity) const
entity->set_faction(this);
}
+void Faction::apply_default(core::Reputation & reputation)
+{
+ // apply default reputation
+ Faction *faction_default = find("default");
+ if (faction_default) {
+ for (core::Reputation::FactionReps::const_iterator rip = faction_default->reputation().factionreps().begin(); rip != faction_default->reputation().factionreps().end(); ++rip) {
+ // only add defaults the reputation doesn't have yet
+ if (!reputation.find((*rip)->faction())) {
+ reputation.set_reputation((*rip)->faction(), (*rip)->reputation());
+ }
+ }
+ }
+}
+
} // namespace game