X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fturrets%2Fturret%2Fewheel.qc;h=7312d0f16d34f624cc0dc37a5217ced176fee5c7;hb=2aba0552fdf2acdebd1ac96fa9ad218605b3742e;hp=403a0ddf6c2bedcefa2a23b8e20d993710137786;hpb=bad136c27b2f10dd2d4761f07b17d3a7f586a051;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/turrets/turret/ewheel.qc b/qcsrc/common/turrets/turret/ewheel.qc index 403a0ddf6c..7312d0f16d 100644 --- a/qcsrc/common/turrets/turret/ewheel.qc +++ b/qcsrc/common/turrets/turret/ewheel.qc @@ -1,7 +1,5 @@ #include "ewheel.qh" -#ifdef IMPLEMENTATION - #ifdef SVQC float autocvar_g_turrets_unit_ewheel_speed_fast; @@ -19,7 +17,7 @@ const int ewheel_anim_bck_fast = 4; 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, 64)) { #ifdef EWHEEL_FANCYPATH if (this.pathcurrent.path_next == NULL) @@ -51,7 +49,6 @@ void ewheel_move_path(entity this) if (this.pathcurrent) { - this.moveto = this.pathcurrent.origin; this.steerto = steerlib_attract2(this, this.moveto, 0.5, 500, 0.95); @@ -231,18 +228,17 @@ void ewheel_draw(entity this) setorigin(this, this.origin + this.velocity * dt); this.tur_head.angles += dt * this.tur_head.avelocity; - if (this.health < 127) + if(GetResource(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 -#endif