]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/default/havocbot/havocbot.qc
Bot AI: implement real-time detection of revival of target frozen players so bot...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / havocbot / havocbot.qc
index 7ce6efa45fc63af8e3bd50991b1bdac3dcf1336c..9d4ef6336104b2d3c6006ddc07b66ad08b5c91e5 100644 (file)
@@ -801,10 +801,14 @@ void havocbot_movetogoal(entity this)
 
        navigation_shortenpath(this);
 
+       bool goalcurrent_can_be_removed = false;
        if (IS_MOVABLE(this.goalcurrent))
        {
-               if (IS_DEAD(this.goalcurrent))
+               // if is movable  =>  not frozen
+               if (IS_DEAD(this.goalcurrent) || (this.goalentity_shouldbefrozen && this.goalentity == this.goalcurrent))
                {
+                       goalcurrent_can_be_removed = true;
+                       // don't remove if not visible
                        if (checkpvs(this.origin + this.view_ofs, this.goalcurrent))
                        {
                                navigation_goalrating_timeout_force(this);
@@ -832,7 +836,7 @@ void havocbot_movetogoal(entity this)
                {
                        if (this.goalcurrent)
                        {
-                               if (IS_MOVABLE(this.goalcurrent) && IS_DEAD(this.goalcurrent))
+                               if (goalcurrent_can_be_removed)
                                {
                                        // remove even if not visible
                                        navigation_goalrating_timeout_force(this);