diff options
author | Stijn Buys <ingar@osirion.org> | 2013-01-06 15:29:02 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-01-06 15:29:02 +0000 |
commit | cf8ab544bcb394e71486a616d7e1efc35d0a26a0 (patch) | |
tree | 9e3d96b2ffcede271343bd1fd40d85b4c01d3225 /src/client | |
parent | 8a238b236ed89b31e21d6da7d1952eea6a29508e (diff) |
Always aim at core::range::fx_distance.
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/targets.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/client/targets.cc b/src/client/targets.cc index 8a7f402..1e5b831 100644 --- a/src/client/targets.cc +++ b/src/client/targets.cc @@ -384,16 +384,14 @@ void frame() } } - - float d = 64.0f; // default aim distance + cursor_aim = render::Camera::eye() + (cursor_aim - render::Camera::eye()) * core::range::fxdistance / math::distance(render::Camera::eye(), cursor_aim); + if (!current_target) { current_target_id = 0; } else { current_target_id = current_target->id(); - d = math::distance(render::Camera::eye(), current_target->location()); } - cursor_aim = render::Camera::eye() + (cursor_aim - render::Camera::eye()) / math::distance(render::Camera::eye(), cursor_aim) * d; // set aim if (core::localcontrol()) { |