float ons_roundlost = (gametype == MAPINFO_TYPE_ONSLAUGHT && STAT(ROUNDLOST));
entity gen = world;
+ float vehicle_viewdist = 0;
+ vector vehicle_viewofs = '0 0 0';
+
+ if(vehicle_chase)
+ {
+ if(hud != HUD_BUMBLEBEE_GUN)
+ {
+ Vehicle info = get_vehicleinfo(hud);
+ vehicle_viewdist = info.height;
+ vehicle_viewofs = info.view_ofs;
+ }
+ }
+
if(ons_roundlost)
{
FOREACH_ENTITY_CLASS("onslaught_generator", it.health <= 0, LAMBDA(
// detect maximum viewoffset and use it
vector view_offset = autocvar_cl_eventchase_viewoffset;
- if(vehicle_chase && autocvar_cl_eventchase_vehicle_viewoffset) { view_offset = autocvar_cl_eventchase_vehicle_viewoffset; }
+ if(vehicle_chase)
+ {
+ if(vehicle_viewofs)
+ view_offset = vehicle_viewofs;
+ else
+ view_offset = autocvar_cl_eventchase_vehicle_viewoffset;
+ }
if(ons_roundlost) { view_offset = autocvar_cl_eventchase_generator_viewoffset; }
if(view_offset)
// make the camera smooth back
float chase_distance = autocvar_cl_eventchase_distance;
- if(vehicle_chase && autocvar_cl_eventchase_vehicle_distance) { chase_distance = autocvar_cl_eventchase_vehicle_distance; }
+ if(vehicle_chase)
+ {
+ if(vehicle_viewofs)
+ chase_distance = vehicle_viewdist;
+ else
+ chase_distance = autocvar_cl_eventchase_vehicle_distance;
+ }
if(ons_roundlost) { chase_distance = autocvar_cl_eventchase_generator_distance; }
if(autocvar_cl_eventchase_speed && eventchase_current_distance < chase_distance)
ATTRIB(Vehicle, mins, vector, '-0 -0 -0')
/** vehicle hitbox size */
ATTRIB(Vehicle, maxs, vector, '0 0 0')
+ /** vehicle 3rd person view offset */
+ ATTRIB(Vehicle, view_ofs, vector, '0 0 0')
+ /** vehicle 3rd person view distance */
+ ATTRIB(Vehicle, height, float, 0)
/** (BOTH) setup vehicle data */
METHOD(Vehicle, vr_setup, void(Vehicle)) { }
/* spawnflags */ ATTRIB(Bumblebee, spawnflags, int, VHF_DMGSHAKE);
/* mins */ ATTRIB(Bumblebee, mins, vector, '-245 -130 -130');
/* maxs */ ATTRIB(Bumblebee, maxs, vector, '230 130 130');
+/* view offset*/ ATTRIB(Bumblebee, view_ofs, vector, '0 0 300');
+/* view dist */ ATTRIB(Bumblebee, height, float, 450);
/* model */ ATTRIB(Bumblebee, mdl, string, "models/vehicles/bumblebee_body.dpm");
/* model */ ATTRIB(Bumblebee, model, string, "models/vehicles/bumblebee_body.dpm");
/* head_model */ ATTRIB(Bumblebee, head_model, string, "");
/* spawnflags */ ATTRIB(Racer, spawnflags, int, VHF_DMGSHAKE | VHF_DMGROLL);
/* mins */ ATTRIB(Racer, mins, vector, '-120 -120 -40' * 0.5);
/* maxs */ ATTRIB(Racer, maxs, vector, '120 120 40' * 0.5);
+/* view offset*/ ATTRIB(Racer, view_ofs, vector, '0 0 50');
+/* view dist */ ATTRIB(Racer, height, float, 200);
/* model */ ATTRIB(Racer, mdl, string, "models/vehicles/wakizashi.dpm");
/* model */ ATTRIB(Racer, model, string, "models/vehicles/wakizashi.dpm");
/* head_model */ ATTRIB(Racer, head_model, string, "null");
/* spawnflags */ ATTRIB(Raptor, spawnflags, int, VHF_DMGSHAKE | VHF_DMGROLL);
/* mins */ ATTRIB(Raptor, mins, vector, '-80 -80 0');
/* maxs */ ATTRIB(Raptor, maxs, vector, '80 80 70');
+/* view offset*/ ATTRIB(Raptor, view_ofs, vector, '0 0 160');
+/* view dist */ ATTRIB(Raptor, height, float, 200);
/* model */ ATTRIB(Raptor, mdl, string, "models/vehicles/raptor.dpm");
/* model */ ATTRIB(Raptor, model, string, "models/vehicles/raptor.dpm");
/* head_model */ ATTRIB(Raptor, head_model, string, "");
/* spawnflags */ ATTRIB(Spiderbot, spawnflags, int, VHF_DMGSHAKE);
/* mins */ ATTRIB(Spiderbot, mins, vector, '-75 -75 10');
/* maxs */ ATTRIB(Spiderbot, maxs, vector, '75 75 125');
+/* view offset*/ ATTRIB(Spiderbot, view_ofs, vector, '0 0 70');
+/* view dist */ ATTRIB(Spiderbot, height, float, 170);
/* model */ ATTRIB(Spiderbot, mdl, string, "models/vehicles/spiderbot.dpm");
/* model */ ATTRIB(Spiderbot, model, string, "models/vehicles/spiderbot.dpm");
/* head_model */ ATTRIB(Spiderbot, head_model, string, "models/vehicles/spiderbot_top.dpm");