|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Sat Jan 31, 2009 12:50 am
%zonenum returns "invalid" data |
I ran the following test:
Code: |
$gzid = %zonenum( )
$bzid = %zonenum( "Non-existent Zone Name")
;;
#ECHO zoneid = $gzid
;;
#ECHO badzid = $bzid
;;
//Currently this is the way one must test for invalid zone names...
;;
#IF ($bzid = $gzid) {#ECHO This is an invalid Zone name.} {#ECHO This is a valid Zone name.}
|
As you can see, if the string passed to %zonenum does not represent an valid zone, the function will return the current zone number.
I believe this happens because, internally, CMUD interprets the NULL returned from the SQL query on ZoneTbl as if it were a NULL passed by the script (requesting the current zone number).
If this is the way it is supposed to work, please, update the documentation because this is not intuitively obvious since one would expect an error return of some kind if the zone did not exist (such as NULL, 0, or -1). |
|
_________________ Sic itur ad astra. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Feb 02, 2009 5:53 pm |
Confirmed and added to the bug list.
|
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|