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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Wed Jun 13, 2007 11:29 am   

problem with %zonenum
 
There is no message displayed when a zone doesn't exist.

#show %zonenum(fsdfef47)

will just show you your current zone instead of -1. Is this intended behavior, and if so, is there anyway to make it work as I am trying to use it. I am using an alias that sets the zone using %zonenum, but sometimes there are inconsistencies with the zone name on my map and the zone name from the mud 'areaname' command. So what is happening is the zone is being set to whatever zone my map is lost defaulted in rather than the zone shown from the areaname command. If i had a way to test against the 'areaname' command giving a result of -1 I could make it prompt me to enter the zone or whatever.
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Jun 13, 2007 4:10 pm   
 
I've added this to the bug list. It is supposed to return -1 if the zone doesn't exist. I'm not sure if there is any workaround for this.
Reply with quote
Thinjon100
Apprentice


Joined: 12 Jul 2004
Posts: 190
Location: Canada

PostPosted: Fri Jul 13, 2007 4:27 pm   
 
I just thought up a "temp" workaround for this until Zugg gets this bug fixed. I just did the following in my code:
(Assume %3 returns the zone name)
Code:

$zonename = %3
$zonenum = %zonenum($zonename )
#IF (%zonename($zonenum) != $zonename) {
  //Handle bad zone name
} {
  //Handle properly-found zone name
}


This way, you get the double-check... if the zone name is bad, it'll return your current zone... when you do %zonename() on that, you'll get your current zone name, which won't match the name of the requested zone... thus you'll know it's invalid, and can adjust as necessary.

Hope that helps :)
_________________
If you're ever around Aardwolf, I'm that invisible guy you can never see. Wizi ftw! :)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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