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);
setorigin(this, this.origin + this.velocity * dt);
this.tur_head.angles += dt * this.tur_head.avelocity;
- if (this.health < 127)
+ if(GetResourceAmount(this, RES_HEALTH) < 127)
if(random() < 0.05)
te_spark(this.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
}
- METHOD(EWheel, tr_setup, void(EWheel this, entity it))
- {
- it.gravity = 1;
- set_movetype(it, MOVETYPE_BOUNCE);
- it.move_time = time;
- it.draw = ewheel_draw;
- }
+METHOD(EWheel, tr_setup, void(EWheel this, entity it))
+{
+ it.gravity = 1;
+ set_movetype(it, MOVETYPE_BOUNCE);
+ it.move_time = time;
+ it.draw = ewheel_draw;
+}
#endif // CSQC