X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fdefault%2Fhavocbot%2Fhavocbot.qc;h=c26d768b038ae55501eb01c011dbb8c07ba74527;hb=c5fcf672c473edef7139d4250398184b8ae17224;hp=dd44bbb4e69e88c2d64cf38037cacbe93da9601a;hpb=f8d1d29d782183456e036ff96a2f55080d980247;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index dd44bbb4e..c26d768b0 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -29,9 +29,12 @@ void havocbot_ai(entity this) if(bot_execute_commands(this)) return; - if(this.goalcurrent) - if(wasfreed(this.goalcurrent)) + while(this.goalcurrent && wasfreed(this.goalcurrent)) + { navigation_poproute(this); + if(!this.goalcurrent) + this.bot_strategytime = 0; + } if (bot_strategytoken == this) if (!bot_strategytoken_taken) @@ -48,7 +51,7 @@ void havocbot_ai(entity this) // TODO: tracewalk() should take care of this job (better path finding under water) // if we don't have a goal and we're under water look for a waypoint near the "shore" and push it - if(IS_DEAD(this)) + if(!(IS_DEAD(this))) if(!this.goalcurrent) if(this.waterlevel == WATERLEVEL_SWIMMING || (this.aistatus & AI_STATUS_OUT_WATER)) { @@ -134,7 +137,7 @@ void havocbot_ai(entity this) //heading = this.velocity; //dprint(this.goalstack01.classname,etos(this.goalstack01),"\n"); if( - this.goalstack01 != this && this.goalstack01 != NULL && ((this.aistatus & AI_STATUS_RUNNING) == 0) && + this.goalstack01 != this && this.goalstack01 && !wasfreed(this.goalstack01) && ((this.aistatus & AI_STATUS_RUNNING) == 0) && !(this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT) ) next = ((this.goalstack01.absmin + this.goalstack01.absmax) * 0.5) - (this.origin + this.view_ofs); @@ -325,7 +328,7 @@ void havocbot_bunnyhop(entity this, vector dir) if(this.goalcurrent.classname=="waypoint") if (!(this.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL)) if(fabs(gco.z - this.origin.z) < this.maxs.z - this.mins.z) - if(this.goalstack01!=NULL) + if(this.goalstack01 && !wasfreed(this.goalstack01)) { gno = (this.goalstack01.absmin + this.goalstack01.absmax) * 0.5; deviation = vectoangles(gno - this.origin) - vectoangles(gco - this.origin); @@ -477,7 +480,7 @@ void havocbot_movetogoal(entity this) // Flying PHYS_INPUT_BUTTON_HOOK(this) = true; - if(this.navigation_jetpack_point.z - STAT(PL_MAX, NULL).z + STAT(PL_MIN, NULL).z < this.origin.z) + if(this.navigation_jetpack_point.z - STAT(PL_MAX, this).z + STAT(PL_MIN, this).z < this.origin.z) { this.movement_x = dir * v_forward * maxspeed; this.movement_y = dir * v_right * maxspeed;