- Joined
- Apr 13, 2008
- Messages
- 1,608
Hi.
Using bj_lastCreatedUnit seems totally logical to me, but I see a lot of users using the GetLastCreatedUnit() instead. Is there a reason for that or they just simply make a mistake?
Another question is:
Do the bj_lastCreatedUnit and its counterparts (e.g.: bj_lastCreatedTimerDialog, etc) leak in BJs? Just because some BJs I checked do not clear the bj_lastWhatevers.
For example:
Thanks for the help.
Using bj_lastCreatedUnit seems totally logical to me, but I see a lot of users using the GetLastCreatedUnit() instead. Is there a reason for that or they just simply make a mistake?
Another question is:
Do the bj_lastCreatedUnit and its counterparts (e.g.: bj_lastCreatedTimerDialog, etc) leak in BJs? Just because some BJs I checked do not clear the bj_lastWhatevers.
For example:
JASS:
function CreateUnitAtLocSaveLast takes player id, integer unitid, location loc, real face returns unit
if (unitid == 'ugol') then
set bj_lastCreatedUnit = CreateBlightedGoldmine(id, GetLocationX(loc), GetLocationY(loc), face)
else
set bj_lastCreatedUnit = CreateUnitAtLoc(id, unitid, loc, face)
endif
return bj_lastCreatedUnit
endfunction
Thanks for the help.