actually, destroying groups makes it non-leakless.
correct but blizzard coded bad DestroyGroup function thats what i mean
He should go for a timer, whether hes a beginner or not. Do it right, from the start.
he could but that requires some knowledge of timer which some people from wc3c discoverd... like expired timers which are nulled may cause bugs and its too complicated to explain to him currently... but correct as well he could learn timers and i am sure he will...
If you didnt notice, hes using IsUnitType in a boolexpr. Without ==true or ==false.
sry i explained it bad... it must be set to "==" only when its alone example:
JASS:
function nobug takes nothing returns boolean
return IsUnitType(u, UNIT_TYPE_DEAD) or IsUnitEnemy(u, p)
endfunction
function bug takes nothing returns boolean
return IsUnitType(u, UNIT_TYPE_DEAD)
endfunction
well code should explain it...
A unit dies instantly, after its life becomes smaller or equal to 0.405. Thus, once its life has reached 0.405, its flagged as dead. And there are no errors with UNIT_TYPE_DEAD to my knowledge.
correct he dies when life <= 0.405 and UNIT_TYPE_DEAD has no errors it checks is unit dead in way when he becomes corpse -> while playing animation and little time after it will returns false so basically its safe to use both but well widget life is fine as well...
GetLastCreatedEffectBJ() being inlines doesnt make it any better. Its still a bug.
doesnt make it any better? i thought you care for 1 extra function call but k...
its a bug? what is that supposed to mean its a global variable not a bug!
so he stores in local variable that effect and then destroys it after... so no leak nor bug
Actually, i was talking about the first function. Then theres CreateNUnitsAtLoc combined with GetLastCreatedUnit or something like that. If he had been writing the spell in Jass from ground up, he would have chosen natives and more efficient ways to code.
well he started learning jass as i did from GUI... he has not any other programming language knowledge.
i am sure he will become better!
True performance...what a load of bullshit. Do you really think you have the WHOLE VM for your spell? Do you really think there are NO other things going on each frame? If yes, i pity you, if no, stop wasting everyones time and write efficient code, not something half-assed that works, but hogs up too much CPU-time.
well what i meant with "true performances", by that i mean example if spell lags as well as will it lag if i cast some other spell (or this spell two times at same time), will it cause lag? cast it 6-8 times at same time will it lag? if answer is no then spell performances are good. you can as well type /fps in game to check out by yourself k?
i think you understand now that i ofc do care and
always care about not using whole VM for spell and ofc with whole map as well.
the problem is i never wasted anyones time i teached him and i by myself write that what you call "efficient code" but his code which you call "unefficient" is faster then your spells which ofc i checked out "/fps" why is that? your spells are more advanced use timers and ofc take cpu time. his spell is at top performances, "could be improved by few MS" and it would not change anything else than making you happy!
half-assed that works, but hogs up too much CPU-time
as i said his spell woks perfectly 100% correct and you can check that out by casting spell yourself u know? you dont need me or anyone else to tell you "you can see that spell is lag-free by casting it yourself 10x times at same time"
do it yourself...
Oh, and your way of thinking is superior to mine? I dont think so.
i really do not know how much you know... maybe you are a genius... i am not i just like math, physics, programming... and such as well i hate history and such. i am good at things i like and bad at things i hate...
even if i like programming there will always be someone who is better then i am but i learn through life and dont care to ask myself every time "hey you are you better then i am?"
Theres something i wanted to say about locations...oh, yeah, theyre like 50 times slower than coordinates and not as easy to use.
correct they are slower ("but ofc not 50x times")
locations are coded in c++ and is a class which ofc is pointer generated in memory and (dynamically) allocated then cleared by RemoveLocation and finally struct in VM is cleared by nulling...
and ofc you are 100% correct when it comes that they are harder to use...
After all i hope i answerd all of your questions as you would like it to be answerd as well if i pissed you i did not ment to as i said before. its just that we think in different way nothing else... i respect your thinking and thinking of people on wc3c. they all think in way like you do and like i did. however i saw it was pointless and talking that to other people was boring and so i quit... thats all i wanted to say nobody is telling you that you are wrong you are correct he could improve performances.
i just said in my option its fine as it is...
if you still did not understand something or have some other questions fell free to ask!
Greets!
~Dark Dragon