diff options
author | Stijn Buys <ingar@osirion.org> | 2014-11-23 23:07:48 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2014-11-23 23:07:48 +0000 |
commit | a6f1fd5ac67993d84de03f66b96f2e88353b9db4 (patch) | |
tree | 6b4879146de75f89508816ef22c9cdbccfde7252 /src | |
parent | 068f25c5f7ec6fd42a16dda1fe6b0fe884523483 (diff) |
Enforce reciprocal reputation.
Diffstat (limited to 'src')
-rw-r--r-- | src/game/base/faction.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/game/base/faction.cc b/src/game/base/faction.cc index 07c0a3a..2afa0b0 100644 --- a/src/game/base/faction.cc +++ b/src/game/base/faction.cc @@ -198,6 +198,20 @@ bool Faction::init() } } } + + // enforce reciprocal reputation + for (core::Info::Registry::iterator it = core::Info::registry().begin(); it != core::Info::registry().end(); it++) { + core::Info *info = (*it); + + if (info->type() == faction_infotype) { + faction = static_cast<Faction *>(info); + + for (core::Reputation::FactionReps::iterator rip = faction->reputation().factionreps().begin(); rip != faction->reputation().factionreps().end(); ++rip) { + Faction *otherfaction = Faction::find((*rip)->faction()->label()); + otherfaction->reputation().set_reputation(faction, (*rip)->reputation()); + } + } + } con_debug << " " << inifile.name() << " " << count << " factions" << std::endl; |