#include "ewheel.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
float autocvar_g_turrets_unit_ewheel_speed_fast;
void ewheel_move_path(entity this)
{
// Are we close enough to a path node to switch to the next?
- if(vdist(this.origin - this.pathcurrent.origin, <, 64))
+ if(turret_closetotarget(this, this.pathcurrent.origin))
{
#ifdef EWHEEL_FANCYPATH
if (this.pathcurrent.path_next == NULL)
if (this.pathcurrent)
{
-
this.moveto = this.pathcurrent.origin;
this.steerto = steerlib_attract2(this, this.moveto, 0.5, 500, 0.95);
METHOD(EWheel, tr_think, void(EWheel thistur, entity it))
{
- float vz;
vector wish_angle, real_angle;
- vz = it.velocity_z;
+ float vz = it.velocity_z;
it.angles_x = anglemods(it.angles_x);
it.angles_y = anglemods(it.angles_y);
it.iscreature = true;
it.teleportable = TELEPORT_NORMAL;
- it.damagedbycontents = true;
- IL_PUSH(g_damagedbycontents, it);
+ if(!it.damagedbycontents)
+ IL_PUSH(g_damagedbycontents, it);
+ it.damagedbycontents = true;
set_movetype(it, MOVETYPE_WALK);
it.solid = SOLID_SLIDEBOX;
it.takedamage = DAMAGE_AIM;
}
#endif // CSQC
-#endif