- Joined
- Jul 6, 2009
- Messages
- 1,885
I ran into problem while i was using structs.
I have a trigger that loops through a struct instance array and to avoid destroyed structs, i used comparison 'If struct_instance != 0 then', but it didn't seem to work as i thought since even when an instance is destroyed, it still doesn't return 0. So i thought of checking if a random member of the destroyed instance is null, but it always returned a normal value.
So my questions are - what's the purpose of the destroy() method if it doesn't null instance's members?
And how to filter out destroyed instances in a loop?
EDIT: For second question, i thought of making a boolean member of a struct and setting it to true upon destruction, but is there another way?
I have a trigger that loops through a struct instance array and to avoid destroyed structs, i used comparison 'If struct_instance != 0 then', but it didn't seem to work as i thought since even when an instance is destroyed, it still doesn't return 0. So i thought of checking if a random member of the destroyed instance is null, but it always returned a normal value.
So my questions are - what's the purpose of the destroy() method if it doesn't null instance's members?
And how to filter out destroyed instances in a loop?
EDIT: For second question, i thought of making a boolean member of a struct and setting it to true upon destruction, but is there another way?