- offset_pos = (pos[0] + offset[0], pos[1] + offset[1])
- if offset_pos[0] >= 0 and \
- offset_pos[0] < self.world.maps[(0,0)].size[0] and \
- offset_pos[1] >= 0 and \
- offset_pos[1] < self.world.maps[(0,0)].size[1]:
- self._surrounding_map[pos] = self.world.maps[(0,0)][offset_pos]
+ big_y, small_y = pan_and_scan(size[0], pos[0], offset[0])
+ big_x, small_x = pan_and_scan(size[1], pos[1], offset[1])
+ big_yx = (big_y, big_x)
+ small_yx = (small_y, small_x)
+ self._surrounding_map[pos] = self.world.maps[big_yx][small_yx]