Optimize Map::test_collision_with_obstacles().
Optimize Map::test_collision_with_entities().