From 71b6b902732bfc0c53033d58f91a6b1e70e8371f Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 21 Feb 2008 21:01:17 +0000 Subject: more minor updates --- src/client/camera.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/client/camera.cc') diff --git a/src/client/camera.cc b/src/client/camera.cc index dcf4acf..d9aa16e 100644 --- a/src/client/camera.cc +++ b/src/client/camera.cc @@ -82,7 +82,7 @@ void set_mode(Mode newmode) { case Track: // switch camera to Track mode mode = Track; - yaw_target = core::game()->localplayer()->control->direction(); + yaw_target = core::localcontrol()->direction(); yaw_current = yaw_target; pitch_target = pitch_track; pitch_current = pitch_target; @@ -91,7 +91,7 @@ void set_mode(Mode newmode) { case Free: // switch camera to Free mode mode = Free; - yaw_target = core::game()->localplayer()->control->direction(); + yaw_target = core::localcontrol()->direction(); yaw_current = yaw_target; pitch_target = pitch_track; pitch_current = pitch_target; @@ -112,7 +112,7 @@ void set_mode(Mode newmode) { void next_mode() { - if (!core::game()->localplayer()->control) { + if (!core::localcontrol()) { set_mode(Overview); return; } @@ -133,20 +133,22 @@ void next_mode() void draw(float elapsed) { - if (!core::game()->localplayer()->control) { + if (!core::localcontrol()) { // switch the camera to Overview of the player is not controling anything if (mode != Overview) { set_mode(Overview); + + camera::target = math::Vector3f(0,0,0); } } else { if (mode == Overview) set_mode(Track); - camera::target = core::game()->localplayer()->control->location(); + camera::target = core::localcontrol()->location(); } if (mode == Track) { - yaw_target = core::game()->localplayer()->control->direction(); + yaw_target = core::localcontrol()->direction(); } if ((mode == Free) || (mode == Track)) { -- cgit v1.2.3