Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2013-11-10 15:11:49 +0000
committerStijn Buys <ingar@osirion.org>2013-11-10 15:11:49 +0000
commit82f0ac05f5da2d89c4a544ca22ff47e116e6dd97 (patch)
treeae48728db2c85aa68387b942f49055a416d09464 /src/game
parent4db4ba29453ef17022ab71d99e1029c32687c6da (diff)
Introduced global variables for reputation hostile/friendly thresholds,
do not allow players to dock at hostile bases, indicate target reputation in the hud target info widget.
Diffstat (limited to 'src/game')
-rw-r--r--src/game/base/game.cc6
-rw-r--r--src/game/base/npc.cc2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/game/base/game.cc b/src/game/base/game.cc
index a628440..fa3e81a 100644
--- a/src/game/base/game.cc
+++ b/src/game/base/game.cc
@@ -236,6 +236,12 @@ void Game::func_target_dock(core::Player *player, core::Entity *entity)
return;
}
+ if (player->reputation(entity->faction()) <= core::range::reputation_hostile) {
+ // FIXME replace with "Denied" voice
+ player->send("Dock denied");
+ return;
+ }
+
Ship * ship = static_cast<Ship *>(player->control());
ship->set_autopilot_target(entity);
diff --git a/src/game/base/npc.cc b/src/game/base/npc.cc
index d09f8a2..ca2a1c2 100644
--- a/src/game/base/npc.cc
+++ b/src/game/base/npc.cc
@@ -140,7 +140,7 @@ Ship *NPC::target_closest_enemy()
}
// reputation threshold to get attacked
- if (reputation >= -50.0f) {
+ if (reputation > core::range::reputation_hostile) {
continue;
}