When using initial with a pre-determined list the result is not what is expected. The compile time value for a list is not working in a manner which is consistent with initial().
Numbered Steps to Reproduce Problem:
1 Use the following code
2 First use the bugged verb
3 Then try the workaround
Code Snippet (if applicable) to Reproduce Problem:
mob/var/tmp/list/buggylist=list("One","Two","Three")
mob/verb/BuggyVerb()
//The initial list is fine
for(var/i in buggylist) usr << i
//If we want compile time value
buggylist=initial(buggylist)
//Now let's toss a runtime error
buggylist += "Four"
//The following lines should never run due to runtime crash
usr << "Re-displaying list..."
for(var/i in buggylist) usr << i
mob/verb/BuggyWorkaroundVerb()
for(var/i in buggylist) usr << i
buggylist=list("One","Two","Three")
buggylist += "Four"
usr << "Re-displaying list..."
for(var/i in buggylist) usr << i
Expected Results:
The compile time list values are restored.
Actual Results:
The list is set in such a manner where using += -= operators on it throw a runtime error.
Does the problem occur:
Every time? Or how often? Always
In other games? Yes
In other user accounts? Yes
On other computers? Yes
When does the problem NOT occur?
When using the workaround or handling the list without the use of initial.
Workarounds:
Reset the list with another list(val1,val2,etc...) combination. For lengthy lists this can make code management difficult.