HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Destructable Questions

12-03-2008, 01:39 AM#1
Zerzax
I'm using some destructable natives for the first time,I have 2 questions at the moment.

1. MoveRectTo() or SetRect? I'm assuming the first maintains the rectangular shape of the rect and merely moves it to the new central coordinates. SetRect is a total re-forming of the Rect's mins and maxes. Is MoveRectTo better if you are using constant x and y mins and maxes? It seems like it's a less expensive native.

2. EnumDestructablesInRect: This function takes the rect in question, a filterfunc/boolexpr and an action function. Does passing a null parameter to the filter or the action cause a memory leak? Because honestly I don't even need an action function...
12-03-2008, 01:49 AM#2
Pyrogasm
Regarding 1.: I've never used MoveRectTo(), I've always used SetRect, though I can't foresee there being any downsides to MoveRectTo(), as long as you know where the center of your rect is.

Regarding 2.: It would probably do the same thing that this does, which is leak memory: call GroupEnumUnitsInRect(MyRect, null)
12-03-2008, 02:17 AM#3
Zerzax
I might as well just use the Action function instead of leaving it empty.. Oh well. MoveRectTo seems to work fine... Though maybe it will be even better with SetRect. Checking now.