From 82f0ac05f5da2d89c4a544ca22ff47e116e6dd97 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 10 Nov 2013 15:11:49 +0000 Subject: 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. --- src/game/base/game.cc | 6 ++++++ src/game/base/npc.cc | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/game') 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(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; } -- cgit v1.2.3