Is there a way to tell if a location is underwater?

Banana Lord

Member
My question is as per the title of the thread. I realized the other day that if someone was using Harvest to farm in the Sea they could end up in the position of running out of Fishy with only one adventure remaining which would result in an infinite loop.
 

lostcalpolydude

Developer
Staff member
> ash $location[the mer-kin outpost]

Returned: The Mer-Kin Outpost
nocombats => false
zone => The Sea
parent => The Sea
parentdesc => The Sea
bounty => none

> ash $location[the mer-kin outpost].zone

Returned: The Sea
 

Winterbay

Active member
I use this function in a script to check if a location is an underwater location:
Code:
boolean sea(location l) {
    string [string,string,boolean,location] locations;
    string [location] container;
    file_to_map("adventures.txt", locations);
    foreach zone, url, something, loc, cond in locations
        container[loc] = zone;
    return (container[l]=="The Sea");
}

It may be possible to make it smaller :)
 

Banana Lord

Member
Just out of curiosity, why not make use of the proxy records as per lost's post? Wouldn't that be more efficient?
PHP:
boolean is_underwater(location loc)
	return loc.zone == "The Sea";
 

Winterbay

Active member
Because that proxy-record wasn't around when I built the function and I have had no need to look over that code since :)
I think. Or maybe I just didn't think about it at the time.
 
Top