Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
The information: udg_CitySpawn[0] == gg_rct_CITY000 becomes useless to me after setup since it makes no difference if i use GetUnitLoc or GetRectCenter.
While we are at it.
MainSetup
Events
Map initialization
Conditions
Actions
-------- Turn OFF Unit Index --------
Set UDexEnabled = False
-------- RUN SETUP --------
Trigger - Run Setup Buildings <gen> (checking conditions)
Trigger - Run Setup City <gen> (checking conditions)
Trigger - Run Setup Player <gen> (checking conditions)
For triggers you should only destroy them once you know you will never need to run them again. Once the trigger is destroyed, it won't work again unless you dynamically re-create it.
If you trigger just is one time event, you can put that line as the very last statement in the action.
e.g.
JASS:
function main takes nothing returns nothing
//your code here
...
//now destroy the trigger
call DestroyTrigger(GetTriggeringTrigger())
endfunction
Alternatively, if the trigger is stored in a global trigger variable, then you can destroy it any time, but once you do, that trigger is gone for good.
In order to remove rects, you can just call
JASS:
call RemoveRect(myRect)
Note again, once you do that, myRect won't work for any functions that use rects as it no longer exists.
In general, unless you have heavy optimization concerns, having a few leaks here and there won't cause any difference. What is really important is when you have functions that generate local handles, that those handles must be destroyed/reclaimed at some point, otherwise WC3 will progressively use more and more memory, until the map is unplayable.
It doesn't appear you are dynamically generating triggers or rects, so I wouldn't lose much sleep over this.
Peanuts. You only run the init trigger once and do not recreate the trigger. Destroying some static remains and especially globals is more prone to cause complications while development.
GetUnitLoc/GetRectCenter creates a new location btw. You can also use GetRectCenterX/Y.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.