If the fake object goes out of scope, then why don't the real objects go out of scope? It looks to me like both the fake objects and the real objects are assigned to
object_type *types[MAX_ITEMLIST+2];
with this:
types[counter] = i_ptr;
And that's declared at the beginning of the function so it wouldn't go out of scope until the function ends. (you're probably right, I'm just trying to understand it)
EDIT: Thanks Derakon,
I moved
to the top of the function and it seems to be fixed now, although I still don't really understand why..
object_type *types[MAX_ITEMLIST+2];
with this:
types[counter] = i_ptr;
And that's declared at the beginning of the function so it wouldn't go out of scope until the function ends. (you're probably right, I'm just trying to understand it)
EDIT: Thanks Derakon,
I moved
Code:
object_type *i_ptr; object_type object_type_body;
Comment