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
GeneralStonewall
Magician


Joined: 02 Feb 2004
Posts: 364
Location: USA

PostPosted: Wed Jun 16, 2010 7:19 am   

[3.19e] BUG: #ADDITEM var "item" allowing duplicates
 
Putting quotations around the item with #additem is allowing duplicates.

code:
Code:
testvar = %null
#print {Using #additem var ~"item~" syntax:}
#10 {
  #additem testvar "blah"
  }
#print {Testvar: @testvar}
testvar = %null
#print {Using #additem var item syntax:}
#10 {
  #additem testvar blah
  }
#print {Testvar: @testvar}


output:
Quote:
Using #additem var "item" syntax:
Testvar: blah|blah|blah|blah|blah|blah|blah|blah|blah|blah
Using #additem var item syntax:
Testvar: blah
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Wed Jun 16, 2010 8:11 am   
 
Confirmed on this end as well. Odd. I wonder if it's because CMUD sees the quotes in the command but doesn't see the quotes in the variable, therefore thinks it's a new item each time...

Charneus
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Jun 16, 2010 4:38 pm   
 
Yep, confirmed. What is happening here is that #ADDITEM first does a search of the list to see if the item already exists. But it is searching for "item" (with the quotes) instead of just searching for item without the quotes. Since it doesn't find "item" in the list, it gets added, and the process of adding a literal string to a list strips the quotes.
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