Bug: Pushed out of unwalkable area while setting destination = stuck

I have a unit that stands in the middle of this red unwalkable area when constructing the building (before it is constructed the area is not unwalkable), when the building is constructed the area is set to unwalkable and the unit is pushed out of the area.

At the same time, the unit sets a new destination, because he is done. Which leads to this happening:

bild

Seems like if the destination is set before or same time unit is pushed out of unwalkable area, unit still thinks his origin is in the uwalkable area, and thinks he is stuck. How can I properly update him and let him know he is not stuck?

EDIT: This was caused due to relying on events, which sequenced this poorly. I replaced event and just call the methods one after another now and it works. Not sure if there was a nicer solution.

1 Like