Auto-translated
once again, does the hero block the only possible path to the desired cell? then everything works according to the mechanics; CanHeroMove considers the hero an impassable obstacle. You can add a check for this situation, and if it occurs, move Erling to the location of your hero, for example.