ID:76850
 
BYOND Version:446
Operating System:Windows XP Pro
Web Browser:Firefox 3.0.11
Status: Deferred

This issue may be low priority or very difficult to fix, and has been put on the back burner for the time being.
Duplicates:id:78351
Descriptive Problem Summary:
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.
This appears to be related to the way a list initializer is saved in the .dmb file. A reference type that should only be used by DM at compile-time is for some reason showing up in DD/DS, so it will take some investigation into the guts of the compiler to find that one out.