Entities are pushed away from invalid tiles

#closes 1058
Merge pull request #1106 from stefanbeller/master

Entities are pushed away from invalid tiles