**/
#endif
-void movelib_groundalign4point(float spring_length, float spring_up, float blendrate, float _max)
-{SELFPARAM();
+void movelib_groundalign4point(entity this, float spring_length, float spring_up, float blendrate, float _max)
+{
vector a, b, c, d, e, r, push_angle, ahead, side;
push_angle.y = 0;
- r = (self.absmax + self.absmin) * 0.5 + (v_up * spring_up);
+ r = (this.absmax + this.absmin) * 0.5 + (v_up * spring_up);
e = v_up * spring_length;
// Put springs slightly inside bbox
- ahead = v_forward * (self.maxs.x * 0.8);
- side = v_right * (self.maxs.y * 0.8);
+ ahead = v_forward * (this.maxs.x * 0.8);
+ side = v_right * (this.maxs.y * 0.8);
a = r + ahead + side;
b = r + ahead - side;
c = r - ahead + side;
d = r - ahead - side;
- traceline(a, a - e,MOVE_NORMAL,self);
+ traceline(a, a - e,MOVE_NORMAL,this);
a.z = (1 - trace_fraction);
r = trace_endpos;
- traceline(b, b - e,MOVE_NORMAL,self);
+ traceline(b, b - e,MOVE_NORMAL,this);
b.z = (1 - trace_fraction);
r += trace_endpos;
- traceline(c, c - e,MOVE_NORMAL,self);
+ traceline(c, c - e,MOVE_NORMAL,this);
c.z = (1 - trace_fraction);
r += trace_endpos;
- traceline(d, d - e,MOVE_NORMAL,self);
+ traceline(d, d - e,MOVE_NORMAL,this);
d.z = (1 - trace_fraction);
r += trace_endpos;
a.x = r.z;
- r = self.origin;
+ r = this.origin;
r.z = r.z;
push_angle.x = (a.z - c.z) * _max;
push_angle.z = (b.z - a.z) * _max;
push_angle.z += (d.z - c.z) * _max;
- //self.angles_x += push_angle_x * 0.95;
- //self.angles_z += push_angle_z * 0.95;
+ //this.angles_x += push_angle_x * 0.95;
+ //this.angles_z += push_angle_z * 0.95;
- self.angles_x = ((1-blendrate) * self.angles.x) + (push_angle.x * blendrate);
- self.angles_z = ((1-blendrate) * self.angles.z) + (push_angle.z * blendrate);
+ this.angles_x = ((1-blendrate) * this.angles.x) + (push_angle.x * blendrate);
+ this.angles_z = ((1-blendrate) * this.angles.z) + (push_angle.z * blendrate);
- //a = self.origin;
- setorigin(self,r);
+ //a = this.origin;
+ setorigin(this,r);
}
**/
#endif
-void movelib_groundalign4point(float spring_length, float spring_up, float blendrate, float _max);
+void movelib_groundalign4point(entity this, float spring_length, float spring_up, float blendrate, float _max);
#endif
return;
fixedmakevectors(this.angles);
- movelib_groundalign4point(300, 100, 0.25, 45);
+ movelib_groundalign4point(this, 300, 100, 0.25, 45);
setorigin(this, this.origin + this.velocity * dt);
this.tur_head.angles += dt * this.tur_head.move_avelocity;
this.angles_y = this.move_angles_y;
entity gun = this.vehicle;
return = true;
+ setself(vehic);
+
// this isn't technically a vehicle (yet), let's not do frame functions on it (yet)
//vehicles_frame(gun, player);
vehic.solid = SOLID_BBOX;
PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false;
this.vehicle_energy = (gun.vehicle_energy / autocvar_g_vehicle_bumblebee_cannon_ammo) * 100;
+
+ setself(this);
}
vector bumblebee_gunner_findgoodexit(vector prefer_spot, entity gunner, entity player)
return;
}
+ setself(vehic);
+
bumblebee_regen(vehic);
crosshair_trace(this);
setorigin(this, vehic.origin + v_up * 48 + v_forward * 160);
PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false;
+
+ setself(this);
}
void bumblebee_land()
return;
}
+ setself(vehic);
+
racer_align4point(vehic, PHYS_INPUT_TIMELENGTH);
PHYS_INPUT_BUTTON_ZOOM(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false;
setorigin(this, vehic.origin + '0 0 32');
this.velocity = vehic.velocity;
+
+ setself(this);
}
void racer_think()
return;
}
+ setself(vehic);
+
vehicles_frame(vehic, this);
float ftmp = 0;
if(IS_DEAD(vehic))
{
PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = false;
- return 1;
+ return;
}
crosshair_trace(this);
VEHICLE_UPDATE_PLAYER(this, vehic, shield, raptor);
PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false;
+
+ setself(this);
}
bool raptor_takeoff(entity this)
entity vehic = this.vehicle;
return = true;
+ setself(this);
+
vehic.nextthink = time;
CSQCMODEL_AUTOUPDATE(vehic);
vehic.nextthink = 0; // will this work?
VEHICLE_UPDATE_PLAYER(this, vehic, shield, raptor);
PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false;
+
+ setself(vehic);
}
void raptor_blowup()
return;
}
+ setself(vehic);
+
vehicles_frame(vehic, this);
PHYS_INPUT_BUTTON_ZOOM(this) = false;
//fixedmakevectors(vehic.angles);
makevectors(vehic.angles + '-2 0 0' * vehic.angles_x);
- WITH(entity, self, vehic, movelib_groundalign4point(autocvar_g_vehicle_spiderbot_springlength, autocvar_g_vehicle_spiderbot_springup, autocvar_g_vehicle_spiderbot_springblend, autocvar_g_vehicle_spiderbot_tiltlimit));
+ movelib_groundalign4point(vehic, autocvar_g_vehicle_spiderbot_springlength, autocvar_g_vehicle_spiderbot_springup, autocvar_g_vehicle_spiderbot_springblend, autocvar_g_vehicle_spiderbot_tiltlimit);
if(IS_ONGROUND(vehic))
vehic.jump_delay = time; // reset now so movement can begin
if(vehic.vehicle_flags & VHF_HASSHIELD)
VEHICLE_UPDATE_PLAYER(this, vehic, shield, spiderbot);
+
+ setself(this);
}
void spiderbot_exit(float eject)