From: Mario Date: Tue, 25 Sep 2018 07:01:16 +0000 (+1000) Subject: Merge branch 'master' into Mario/monsters X-Git-Tag: xonotic-v0.8.5~7^2~1^2~38 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=daaa815e35ec0cb95c8b5ae90e4dc8ff4bcf6eef;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into Mario/monsters --- daaa815e35ec0cb95c8b5ae90e4dc8ff4bcf6eef diff --cc qcsrc/common/monsters/sv_monsters.qc index 938d22c464,f30c5974a0..29f907a904 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@@ -682,8 -658,43 +682,7 @@@ vector Monster_Move_Target(entity this } } -void Monster_CalculateVelocity(entity this, vector to, vector from, float turnrate, float movespeed) -{ - //float current_distance = vlen((('1 0 0' * to.x) + ('0 1 0' * to.y)) - (('1 0 0' * from.x) + ('0 1 0' * from.y))); // for the sake of this check, exclude Z axis - //float initial_height = 0; //min(50, (targ_distance * tanh(20))); - //float current_height = (initial_height * min(1, (this.pass_distance) ? (current_distance / this.pass_distance) : current_distance)); - //print("current_height = ", ftos(current_height), ", initial_height = ", ftos(initial_height), ".\n"); - - vector targpos = to; -#if 0 - if(current_height) // make sure we can actually do this arcing path - { - targpos = (to + ('0 0 1' * current_height)); - WarpZone_TraceLine(this.origin, targpos, MOVE_NOMONSTERS, this); - if(trace_fraction < 1) - { - //print("normal arc line failed, trying to find new pos..."); - WarpZone_TraceLine(to, targpos, MOVE_NOMONSTERS, this); - targpos = (trace_endpos + '0 0 -10'); - WarpZone_TraceLine(this.origin, targpos, MOVE_NOMONSTERS, this); - if(trace_fraction < 1) { targpos = to; /* print(" ^1FAILURE^7, reverting to original direction.\n"); */ } - /*else { print(" ^3SUCCESS^7, using new arc line.\n"); } */ - } - } - else { targpos = to; } -#endif - - //this.angles = normalize(('0 1 0' * to_y) - ('0 1 0' * from_y)); - - vector desired_direction = normalize(targpos - from); - if(turnrate) { this.velocity = (normalize(normalize(this.velocity) + (desired_direction * 50)) * movespeed); } - else { this.velocity = (desired_direction * movespeed); } - - //this.steerto = steerlib_attract2(targpos, 0.5, 500, 0.95); - //this.angles = vectoangles(this.velocity); -} - .entity draggedby; - .entity target2; void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed) {