🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
Ohh, but that's just simple leak fixing...
If you are using hashtables to store locations, you'd better store the coördinates...
I'll give you an example:
Actions
Hashtable - Save Handle Of(Center of (Playable map area)) as 0 of (Key (Triggering unit)) in (Last created hashtable)
OR:
Actions
Set Location = (Center of (Playable map area))
Hashtable - Save Handle OfLocation as 0 of (Key (Triggering unit)) in (Last created hashtable)
Well, in any case: you can't remove that location since you store it.
From the moment you remove the location, the stored location will also be removed, thus the entire spell (or whatever it is you are doing) fails.
However, reals aren't removed when a location is removed, thus it's best to do something like this:
Actions
Set Location = (Center of (Playable map area))
Hashtable - Save (X of Location) as 0 of (Key (Triggering unit)) in (Last created hashtable)
Hashtable - Save (Y of Location) as 1 of (Key (Triggering unit)) in (Last created hashtable)
Custom script: call RemoveLocation(udg_Location)
Now it removes the leak caused by the handle (in this case the location), while the stored data still remains.
To recall the data, simply do something like this:
Actions
Set Location = (Point((Load 0 of (Key (Picked unit)) from (Last created hashtable)), (Load 1 of (Key (Picked unit)) from (Last created hashtable))))
(this can be done with the "Convert coördinates to point" function).
(If you did not know about removing leaks yet, leaks are the main cause of lag and may slow down the game or even make it crash.
Read this post to see what leaks and how to fix it).
If I am completely wrong, please explain a bit further ^^
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.