When using : with a variable that has been typecast as something (anything. any datum will do), using : will not recognize user-defined variables of another type.
Numbered Steps to Reproduce Problem:
1: create a user-defined variable
2: create a variable and typecast it (as anything other than the object with the user-defined variable)
3: assign it an object of that type (optional)
4: use : to access the user-defined variable
5: compiler error, yay
Code Snippet (if applicable) to Reproduce Problem:
mob
var
variablex
verb
test()
var/obj/testy = src
src << testy:variablex
Expected Results:
It'd do what it's supposed to do.
Actual Results:
It doesn't.
Does the problem occur:
Every time? Or how often? Yes.
In other games? Yes.
In other user accounts? Maybe.
On other computers? Possibly.
When does the problem NOT occur?
When the object is either (a) not typecast as something other than the object we're trying to access (b) not typecast at all
Workarounds:
Create a new variable that is typecast properly so we can access it one single time when we've already clarified that the object is of the type we want it to be.
Or don't typecast it at all. Which I would rather not do.
This is what I'm doing:
var/super_parent/super_parent = (super_parent/parent/child)
if (is_child) super_parent = super_parent:parent
if (is_parent) super_parent = super_parent:super_parent
if (!is_super_parent) return // failed to return a super parent
// use the super parent
Except with so much more detail.