HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

What does "GetTriggerEvalCount(Trigger) returns integer" do?

05-17-2004, 08:07 AM#1
Flakey
Just about got Jass, just looking though other peoples code picking up on functions and getting a feel for the language.
What does the function in the title do?
Cheers guys.

Also how/why does the exploit work? ie
function IntegerToHandle / function HandleToInteger
(I know how to use it, just wondering why it works)

I think thats it for now.
05-17-2004, 09:42 AM#2
Cubasis
About the return bug exploiters. That's simply a abusal of the compiler and the internal data system. That is, in reality, all types in WC3 are 32 bit, wether they be booleans, integers, string (pointer), handle (pointer). They all are 32 bit. So, the way the bug works, is that it is a simple function that has 2 returns in a row, one that returns the passed in parameter, which "wouldn't" normally work, becouse the function is supposed to return a int/handle, and then a second return that returns a simple 0/null. The thing is, the Compiler only "checks" the last return statement in the function, so as it is valid, you're allowed to return any type elsewhere in the function.

Oh, and that function, it returns the times a trigger has run (it's conditions evaluated to true).

Cubasis