Numbered Steps to Reproduce Problem:
1.Create a new project.
2.Replace it with the snippet below.
3.Run it and see the top option shows a " instead of the first item, followed by the 2nd item.
Code Snippet (if applicable) to Reproduce Problem:
mob
verb
Input_Test()
var/a=input("What is it that you want to choose?","Input Test")as null|anything in usr
if(a)
world<<"[a] was chosen."
Login()
..()
new /obj(src)
mob
verb
Input_Test()
var/a=input("What is it that you want to choose?","Input Test")as null|anything in usr.contents
if(a)
world<<"[a] was chosen."
Login()
..()
new /obj(src)
Expected Results:Even though it uses "usr" rather than "src" it shouldn't be adding the extra item in the list.
Actual Results:It adds a " to the list of items.
Does the problem occur:
Every time? Or how often?Every Time
In other games?Yes
In other user accounts?Yes
On other computers?Yes
When does the problem NOT occur?When using "src" instead of "usr"
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.)
Untested.
Workarounds:
Various, look below for other solutions that work.
mob
verb
Input_Test()
var/a=input("What is it that you want to choose?","Input Test")as null|anything in src
if(a)
world<<"[a] was chosen."
Login()
..()
new /obj(src)
mob
verb
Input_Test()
var/a=input("What is it that you want to choose?","Input Test")as null|anything in src.contents
if(a)
world<<"[a] was chosen."
Login()
..()
new /obj(src)
mob
verb
Input_Test()
var/mob/a=usr
var/b=input("What is it that you want to choose?","Input Test")as null|anything in a
if(b)
world<<"[b] was chosen."
Login()
..()
new /obj(src)
mob
verb
Input_Test()
var/mob/a=usr
var/b=input("What is it that you want to choose?","Input Test")as null|anything in a.contents
if(b)
world<<"[b] was chosen."
Login()
..()
new /obj(src)
If anything you expect the last two to fail as well since it's just assigning a variable with the usr variable which fails in the above tests, but it works anyways in these cases.