Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/camera.cc')
-rw-r--r--src/client/camera.cc14
1 files changed, 8 insertions, 6 deletions
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)) {