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/platform.cc')
-rw-r--r--src/game/base/platform.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/game/base/platform.cc b/src/game/base/platform.cc
index 15c7576..77059ae 100644
--- a/src/game/base/platform.cc
+++ b/src/game/base/platform.cc
@@ -50,35 +50,37 @@ void Platform::frame(const unsigned long elapsed)
for (core::Zone::Content::iterator zit = zone()->content().begin(); zit != zone()->content().end(); ++zit) {
if ((*zit)->moduletype() == ship_enttype) {
- Ship *ship = static_cast<Ship *>((*zit));
+ Ship *other_ship = static_cast<Ship *>((*zit));
- if ((ship->state() != Normal) && (ship->state() != ImpulseInitiate) && (ship->state() != Impulse)) {
+ if ((other_ship->state() != Normal) && (other_ship->state() != ImpulseInitiate) && (other_ship->state() != Impulse)) {
continue;
}
- const float d = math::distance(location(), ship->location());
- const float r = radius() + ship->radius();
+ const float d = math::distance(location(), other_ship->location());
+ const float r = radius() + other_ship->radius();
// too far
if (d > weapon_range + r) {
continue;
}
+ // reputation is interprated as "what others think of me"
float reputation = 0.0f;
- if (ship->owner()) {
- // check owner reputation for the faction the NPC belongs to
- reputation = ship->owner()->reputation(faction());
+ if (other_ship->owner()) {
+ // check owner reputation for the faction this platform belongs to
+ reputation = other_ship->owner()->reputation(faction());
- } else if (faction() && (faction()->type() == Faction::infotype())) {
- //check my faction reputation for the other ships's faction
- reputation = static_cast<const Faction *>(faction())->reputation(ship->faction());
+ } else if (other_ship->faction()) {
+ // check other ships's faction for the faction this platform belongs to
+ assert(other_ship->faction()->type() == Faction::infotype());
+ reputation = static_cast<const Faction *>(other_ship->faction())->reputation(faction());
}
// reputation threshold to get attacked
if (reputation > core::range::reputation_hostile) {
continue;
}
- enemylist.push_back(ship);
+ enemylist.push_back(other_ship);
}
}