Update "locations.c"

Made some improvements to the "InVentarrisTerritory" and
"SearchLocation" functions in "locations.c".