if(self.tag_entity && wasfreed(self.tag_entity))
self.tag_entity = world;
- viewloc_SetTags();
+ if(self.viewloc && wasfreed(self.viewloc))
+ self.viewloc = world;
+
+ if(self.viewloc.entnum != self.tag_networkviewloc)
+ self.viewloc = findfloat(world, entnum, self.tag_networkviewloc);
if(self.tag_networkentity)
{
break;
}
- if((self.owner.sv_entnum == player_localentnum - 1) && autocvar_chase_active <= 0)
+ entity view = CSQCModel_server2csqc(self.owner.sv_entnum + 1);
+ if(view.viewloc)
+ {
+ makevectors(view.angles);
+ vector org = view.origin + view.view_ofs;
+ switch(self.HookType)
+ {
+ default:
+ case ENT_CLIENT_HOOK:
+ a = org + v_forward * vs.x + v_right * -vs.y + v_up * vs.z;
+ b = self.origin;
+ break;
+ case ENT_CLIENT_ARC_BEAM:
+ if(self.HookRange)
+ b = org + v_forward * self.HookRange;
+ else
+ b = org + v_forward * vlen(self.velocity - self.origin); // honor original length of beam!
+ WarpZone_TraceLine(org, b, MOVE_NORMAL, world);
+ b = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
+ a = org + v_forward * vs.x + v_right * -vs.y + v_up * vs.z;
+ break;
+ }
+ }
+ else if((self.owner.sv_entnum == player_localentnum - 1) && autocvar_chase_active <= 0)
{
switch(self.HookType)
{
../common/vehicles/cl_vehicles.qc
../common/vehicles/vehicles.qc
+../common/viewloc.qc
+
../common/weapons/weapons.qc // TODO
../csqcmodellib/cl_model.qc
-//#define COMPAT_VEX
-
-#ifndef COMPAT_VEX
#include "util.qh"
#if defined(CSQC)
#elif defined(SVQC)
#include "../server/defs.qh"
#endif
-#endif
#ifdef SVQC
void viewloc_SetTags()
{
-#ifdef COMPAT_VEX
- entity self = CSQCModel_server2csqc(player_localentnum);
-#endif
-
if(self.viewloc && wasfreed(self.viewloc))
self.viewloc = world;
self.viewloc = findfloat(world, entnum, self.tag_networkviewloc);
}
-#ifdef COMPAT_VEX
-entity view;
-#endif
+vector old_camera_angle = '0 0 0';
void viewloc_SetViewLocation()
{
-#ifdef COMPAT_VEX
- if(!view) { view = spawn(); }
-
- view.viewloc = findfloat(world, entnum, getstati(STAT_VIEWLOC));
- view.origin = pmove_org;
-#else
entity view = CSQCModel_server2csqc(player_localentnum);
-#endif
if(!view) { return; }
//NOTE: the "cam_" cvars sould probably be changed out with a spawnflag or an entity key. I have it like this for my testing -- Player_2
if(view.viewloc && !wasfreed(view.viewloc) && view.viewloc.enemy && view.viewloc.goalentity)
#include "cl_model.qh"
#include "cl_player.qh"
#include "../server/t_viewloc.qh"
+ #include "../common/viewloc.qh"
#elif defined(MENUQC)
#elif defined(SVQC)
#endif
#include "race.qh"
#include "playerdemo.qh"
#include "t_viewloc.qh"
+ #include "../common/viewloc.qh"
#endif
.float race_penalty;
if(time < self.ladder_time)
self.disableclientprediction = 1;
- viewloc_PlayerPhysics();
+ if(self.viewloc)
+ {
+ self.disableclientprediction = 1;
+ vector oldmovement = self.movement;
+ self.movement_x = oldmovement_y;
+ self.movement_y = 0;
+
+ if(self.movement_x < 0)
+ self.movement_x = -self.movement_x;
+
+ vector level_start, level_end;
+ level_start = self.viewloc.enemy.origin;
+ level_end = self.viewloc.goalentity.origin;
+ vector forward, backward;
+ forward = vectoangles(normalize(level_end - level_start));
+ backward = vectoangles(normalize(level_start - level_end));
+
+ if(self.movement_x < 0) // left
+ self.angles = backward;
+ if(self.movement_x > 0) // right
+ self.angles = forward;
+
+ if(oldmovement_x > 0)
+ self.v_angle_x = self.angles_x = -50;
+
+ if(!self.BUTTON_CROUCH)
+ self.BUTTON_CROUCH = (oldmovement_x < 0);
+ }
if(self.frozen)
{
../common/turrets/turrets.qc
../common/turrets/util.qc
../common/vehicles/vehicles_include.qc
+../common/viewloc.qc
../common/urllib.qc
../common/util.qc
../common/weapons/config.qc
-#ifndef COMPAT_VEX
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
#include "defs.qh"
#include "t_viewloc.qh"
#endif
-#endif
#ifdef SVQC