Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-08-06 20:24:28 +0000
committerStijn Buys <ingar@osirion.org>2008-08-06 20:24:28 +0000
commit8d45578fcda02132d24af6065b8cf3b48a37c49c (patch)
tree5b139bc72fdda2fe11ede13986307f1d6548664f /src/client/targets.cc
parentd240084aa7e41725a0228e123080aa7fe8a241b7 (diff)
smaller target_center selection cone, don't draw notification when draw_ui is disabled
Diffstat (limited to 'src/client/targets.cc')
-rw-r--r--src/client/targets.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/targets.cc b/src/client/targets.cc
index 128064e..c0b8e77 100644
--- a/src/client/targets.cc
+++ b/src/client/targets.cc
@@ -74,7 +74,10 @@ unsigned int hover()
void select_target(core::Entity *entity)
{
current_target = entity;
- current_target_id = current_target->id();
+ if (entity)
+ current_target_id = current_target->id();
+ else
+ current_target_id = 0;
core::application()->notify_sound("ui/target");
}
@@ -219,7 +222,7 @@ void func_target_center(std::string const &args)
math::Vector3f v(entity->state()->location() - render::Camera::eye());
v.normalize();
- if (is_legal_target(entity) && math::dotproduct(render::Camera::axis().forward(), v) > 0.5 ) {
+ if (is_legal_target(entity) && math::dotproduct(render::Camera::axis().forward(), v) > 0.85 ) {
// calculate the distance from entity location to the line [eye - cursor]
float d = math::Vector3f::length(math::crossproduct( (center - render::Camera::eye()) , (render::Camera::eye() - entity->location()))) / math::Vector3f::length(center - render::Camera::eye());