Descriptive Problem Summary:
If you define var/name in /datum/, initial(name) does not return anything.
Numbered Steps to Reproduce Problem:
See below.
Code Snippet (if applicable) to Reproduce Problem:
/datum/
var/name
/atom/movable/New(var/desired_loc)
world.log << "The name is: [initial(name)]."
return ..()
Expected Results:
Prints the initial name.
Actual Results:
Does not print the initial name; prints nothing.
Does the problem occur:
Every time? Or how often? Yes
In other games? Yes
In other user accounts? Unknown
On other computers? Unknown
When does the problem NOT occur?
Removing var/name in /datum/ works.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked?
Occurs in 513 and 512
Workarounds:
Don't use var/name
The cornerstone of this issue is that for some time I've been compressing the var definitions for each prototype into a single list to avoid old code which had to loop successively through parent types to find a definition. This compression however does not take into consideration the case when a parent type defines a soft var (user-defined), and the child type is a hard-coded one that defines certain hard vars.