A complete workshop implementation, I guess
[carveJwlIkooP6JGAAIwe30JlM.git] / player_common.c
index 110ee1640e33d0fd85816c44ee6d05a67a5b629d..f807e3a580f2213b41700d96fc85b9c7e15d73ef 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef PLAYER_COMMON_C
 #define PLAYER_COMMON_C
 
+#include "ent_skateshop.h"
 #include "player.h"
 #include "conf.h"
 #include "input.h"
@@ -236,6 +237,8 @@ VG_STATIC void player__cam_iterate( player_instance *player )
 
 VG_STATIC void player_look( player_instance *player, v3f angles )
 {
+   if( vg_ui.wants_mouse ) return;
+
    angles[2] = 0.0f;
 
    v2f mouse_input;
@@ -253,8 +256,21 @@ VG_STATIC void player_look( player_instance *player, v3f angles )
       input_y *= -1.0f;
 
    angles[1] += input_y;
-
    angles[1] = vg_clampf( angles[1], -VG_PIf*0.5f, VG_PIf*0.5f );
 }
 
+struct player_board *player_get_player_board( struct player_instance *player )
+{
+   struct player_board *board = NULL;
+
+   if( localplayer.board_view_slot ){
+      struct cache_board *cache_view = localplayer.board_view_slot;
+      if( cache_view->state == k_cache_board_state_loaded ){
+         board = &cache_view->board;
+      }
+   }
+
+   return board;
+}
+
 #endif /* PLAYER_COMMON_C */