Wierd equality thing with $location

dj_d

Member
Code:
> ash print ($location[airship] == $location[fantasy airship])
false

> ash print ($location[airship] == $location[Airship])
true

> ash print ($location[airship] == $location[IAmNotALocation])
Bad location value: "IAmNotALocation" ()

Why didn't the first one return true? How do I 'canonicalize' my string in to whatever the internal representation of the area is within mafia, so the thing I enter can be compared with mafia's internal data files?
 

Bale

Minion
[quote author=dj_d link=topic=2145.msg11015#msg11015 date=1231746504]
Code:
> ash print ($location[airship] == $location[fantasy airship])
false

> ash print ($location[airship] == $location[Airship])
true

> ash print ($location[airship] == $location[IAmNotALocation])
Bad location value: "IAmNotALocation" ()

Why didn't the first one return true? How do I 'canonicalize' my string in to whatever the internal representation of the area is within mafia, so the thing I enter can be compared with mafia's internal data files?
[/quote]

The answer to "why" becomes clear if you do:

ash print ($location[airship])
ash print ($location[fantasy airship])

Apparently $location is not set to the value of the internal representation of the location.
 

dj_d

Member
I know - I guess this is a request for a change, coupled with a "maybe i don't get it and a change isn't required" post.

But it seems like there should be a way to cast a string to a location, such that it becomes a canonical location, and loses all its string-ness.
 

Veracity

Developer
Staff member
Fixed in revision 6749:

> ash print ($location[airship])

Fantasy Airship
Returned: void

> ash print ($location[fantasy airship])

Fantasy Airship
Returned: void

> ash print ($location[airship] == $location[fantasy airship])

true
Returned: void
 
Top