]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/view.qc
Merge branch 'master' into terencehill/menu_listbox_changes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / view.qc
index 6efd6c54a488c8438e2c51a092436a9e9ca7be8e..35793364fafd3c60c9853065064f39a32f6bc840 100644 (file)
@@ -1,25 +1,31 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "defs.qh"
-       #include "../common/constants.qh"
-       #include "../common/stats.qh"
-       #include "../warpzonelib/mathlib.qh"
-       #include "../warpzonelib/common.qh"
-       #include "../warpzonelib/client.qh"
-       #include "../common/teams.qh"
-       #include "../common/util.qh"
-       #include "../common/nades.qh"
-       #include "../common/weapons/weapons.qh"
-       #include "../common/mapinfo.qh"
-       #include "autocvars.qh"
-       #include "hud.qh"
-       #include "scoreboard.qh"
-       #include "noise.qh"
-       #include "main.qh"
-       #include "../csqcmodellib/cl_player.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "_all.qh"
+
+#include "announcer.qh"
+#include "hook.qh"
+#include "hud.qh"
+#include "hud_config.qh"
+#include "mapvoting.qh"
+#include "noise.qh"
+#include "scoreboard.qh"
+#include "shownames.qh"
+#include "vehicles/all.qh"
+#include "waypointsprites.qh"
+
+#include "../common/constants.qh"
+#include "../common/mapinfo.qh"
+#include "../common/nades.qh"
+#include "../common/stats.qh"
+#include "../common/triggers/target/music.qh"
+#include "../common/teams.qh"
+#include "../common/util.qh"
+
+#include "../common/weapons/all.qh"
+
+#include "../csqcmodellib/cl_player.qh"
+
+#include "../warpzonelib/client.qh"
+#include "../warpzonelib/common.qh"
+#include "../warpzonelib/mathlib.qh"
 
 entity porto;
 vector polyline[16];
@@ -54,7 +60,7 @@ void Porto_Draw()
        portal_number = 0;
        nextdir = dir;
 
-       for(0;;)
+       for (;;)
        {
                dir = nextdir;
                traceline(p, p + 65536 * dir, true, porto);
@@ -763,7 +769,7 @@ void UpdateCrosshair()
                wcross_alpha_goal_prev = wcross_alpha;
                wcross_color_goal_prev = wcross_color;
 
-               if(shottype == SHOTTYPE_HITTEAM || (shottype == SHOTTYPE_HITOBSTRUCTION && autocvar_crosshair_hittest_blur && !autocvar_chase_active))
+               if(spectatee_status == -1 && shottype == SHOTTYPE_HITTEAM || (shottype == SHOTTYPE_HITOBSTRUCTION && autocvar_crosshair_hittest_blur && !autocvar_chase_active))
                {
                        wcross_blur = 1;
                        wcross_alpha *= 0.75;
@@ -1048,7 +1054,11 @@ void CSQC_UpdateView(float w, float h)
 
        CSQCPlayer_SetCamera();
 
-       myteam = GetPlayerColor(player_localentnum - 1);
+       if(player_localentnum <= maxclients) // is it a client?
+               current_player = player_localentnum - 1;
+       else // then player_localentnum is the vehicle I'm driving
+               current_player = player_localnum;
+       myteam = GetPlayerColor(current_player);
 
        if(myteam != prev_myteam)
        {
@@ -1358,18 +1368,20 @@ void CSQC_UpdateView(float w, float h)
                }
        }
        else
+       {
 #ifdef CAMERATEST
-       if(autocvar_camera_enable)
+               if(autocvar_camera_enable)
 #else
-       if(autocvar_camera_enable && isdemo())
+               if(autocvar_camera_enable && isdemo())
 #endif
-       {
-               // Enable required Darkplaces cvars
-               chase_active_backup = autocvar_chase_active;
-               cvar_set("chase_active", "2");
-               cvar_set("cl_demo_mousegrab", "1");
-               camera_active = true;
-               camera_mode = false;
+               {
+                       // Enable required Darkplaces cvars
+                       chase_active_backup = autocvar_chase_active;
+                       cvar_set("chase_active", "2");
+                       cvar_set("cl_demo_mousegrab", "1");
+                       camera_active = true;
+                       camera_mode = false;
+               }
        }
 
        // Draw the Crosshair
@@ -1491,7 +1503,7 @@ void CSQC_UpdateView(float w, float h)
 
                        if(zoomscript_caught)
                                f = 1;
-                       else 
+                       else
                                f = current_zoomfraction;
 
                        if(f)