ID:853468
 
Code:
    verb
Create_Unit() // Create a unit
var/Unit/NU = new()
NU.Commander = src
NU.ID = ++src.LastUnit
src.ActiveUnit = NU

Save_Unit() // Saves Units
src.EditMode = 0
src.ActiveUnit = null
src.Units += src.ActiveUnit
for(var/mob/M in src.client.screen)
src.client.screen -= M

Delete_Unit(ID as num) // Delete a unit
for(var/Unit/A in src.Units)
if(A.ID == ID)
A.Disband()
return

verb
Edit_Units() // Allows player to edit units
if(length(usr.Units) <= 0)
src.EditMode = 1
src.Create_Unit()
src << output("Creating Unit","UnitForm.Chat")

else
var/L = list()
for(var/Unit/U in src.Units)
L += "[U.ID]"
L += "New Unit"
var/X = input(src,"Which Unit would you like to edit?","EDIT UNIT") in L
var/Unit/UNIT
for(var/Unit/U in src.Units)
if(U.ID == "[X]")
UNIT = U
break
if(isnull(UNIT))
src.Create_Unit()
else
src.ActiveUnit = UNIT
return


Problem description:
For some reason, the input list doesn't appear. Here are the steps I go through to get it up.

1. Run Edit_Unit() for the first time.
2. Save_Units()
3. Run Edit_Unit() again.

My debugging statement tells me that the else in Edit_Unit() is reached after the save. I figure at the very least, "New Unit" should be in the list but it doesn't appear at all.

Have you tried outputting the contents of the list to see what it contains?
Hmmm. Outputting the list shows me that there is only one thing in the list: New Unit. I'm guessing that means I default to the New Unit option.
Pretty much.
Stuff isn't being added to the list.