Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: 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.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Feb 02, 2009 5:53 pm   
 
Confirmed and added to the bug list.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net