[Trigger] Points

Status
Not open for further replies.
Ehh is storing point into an indexed variable even possible? I tried storing a point into a temporary variable then stored it into an indexed variable. Im losing the saved point as soon as i destroy the temp point. So i was wondering if you index the point and it gets destroyed during deindex will the spell still properly? Or it can be fixed by simply not storing the point into a temp variable
 
Variables are pointers that point on a part in memory.
If you do "A = B" with objects, it just copies the pointer from "A" to "B" but does not copy the object itself.
A new object won't get created here, but now you have 2 variables pointing on the very same object.
So if you destroy the object from variable "A", the pointed object for "B" also gets destroyed and vice versa.

Your:
Set A = CreatePoint(x,y)
Set B = A
Destroy A
// Now both are destroyed

Solution
Set A = CreatePoint(x,y)
Set B = CreatePoint(x,y)
Destroy A

Or what an idea might be is just not to use a temp variable for it.
I mean you anyway index it, so you might used just the indexed point.
 
Status
Not open for further replies.
Back
Top