ID:96533
 
Resolved
Using input() on a very large list was not properly pruning out items with the same name.
BYOND Version:468
Operating System:Windows 7 Home Premium 64-bit
Web Browser:Firefox 3.6.3
Applies to:Dream Daemon
Status: Resolved (471)

This issue has been resolved.
Duplicates:id:97344
Descriptive Problem Summary:
When I try to use my edit verb to edit the location of a mob or object, when I try to edit its reference, which would usually let you edit say an object or something to someone's inventory, it crashes the server. It has never done this until the new version.
Numbered Steps to Reproduce Problem:
Use the verb edit, select a variable(loc etc), select reference, crash
Code Snippet (if applicable) to Reproduce Problem:
Edit(var/O as obj|mob|turf in range(12))
set category="GM"
var/variable=input("Which variable would you like to edit?","Edit") in O:vars+list("Cancel")
if(variable=="Cancel")return
var/default
var/type=O:vars[variable]
if(isnull(type))default="Text"
else if(isnum(type))default="Number"
else if(istext(type))default="Text"
else if(isloc(type))default="Reference"
else if(isicon(type))
type="\icon[type]"
default="Icon"
else if(istype(type,/atom)||istype(type,/datum))default="Type"
else if(istype(type,/list))default="List"
else if(istype(type,/client))default="Cancel"
else default="File"
var/varg=input("What kind of variable?","Variable Type",default) in list("Text","Number","Type","Reference","Icon","File","Restore to default","List","Clear","Cancel")
switch(varg)
if("Restore to default")O:vars[variable] = initial(O:vars[variable])
if("Text")O:vars[variable]=input("Enter new text:","Text",O:vars[variable]) as text
if("Number")O:vars[variable]=input("Enter new number:","Number",O:vars[variable]) as num
if("Type")O:vars[variable]=input("Enter type:","Type",O:vars[variable]) in typesof(/obj,/mob,/area,/turf)
//this is where it crashes
if("Reference")O:vars[variable]=input("Select reference:","Reference",O:vars[variable]) as mob|obj|turf|area in world
//
if("File")O:vars[variable]=input("Pick file:","File",O:vars[variable]) as file
if("Icon")O:vars[variable]=input("Pick icon:","Icon",O:vars[variable]) as icon
if("List")input("This is what's in [variable]") in O:vars[variable] + list("Close")
if("Clear")if(alert("Are you sure you want to clear this variable?","Clear","Yes","No")=="Yes")O:vars[variable]=null
if(GM<3)for(var/mob/player/M in world)if(M.GM&&M!=src)M<<"[src] edited [O] of [variable] to [O:vars[variable]]."


Expected Results:
It works
Actual Results:
It crashes the game
Does the problem occur:
Every time? Or how often? Every time
In other games? Dunno. I only deal with naruto next generation
In other user accounts? it does the same no matter who uses the verb
On other computers? the other people who've used this verb have different computers

When does the problem NOT occur?
When I choose something other than reference
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Probably the one right before this.
Workarounds:
I dunno.
I wasn't able to verify this in 468. Everything acted as it was supposed to.

Please retest in older versions so we can narrow down where the problem appeared. It would also be helpful if you could obtain crash details in 468 such as which module is crashing at at which offset in the file, which would help me trace back the issue.