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);
{
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);
this.goalcurrent_distance_z = FLOAT_MAX;
this.goalcurrent_distance_time = 0;
this.goalentity_lock_timeout = 0;
+ this.goalentity_shouldbefrozen = false;
this.goalentity = NULL;
this.goalcurrent = NULL;
this.goalstack01 = NULL;
this.aistatus |= AI_STATUS_STUCK;
}
}
+ this.goalentity_shouldbefrozen = boolean(STAT(FROZEN, this.goalentity));
}
void botframe_updatedangerousobjects(float maxupdate)