TODO: improve safe teleport location logic