• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

Help with map and return bug fix

Status
Not open for further replies.
Level 14
Joined
Jul 26, 2008
Messages
1,009
As most know the 1.24b patch caused maps with the return bug to no longer work.

I know JASS and vJASS but the return bug was never one I learned about. I've hardly used the return function for that matter. I've taken it upon myself to learn the return bug but most information I find on it is highly technical, meaning learning it isn't easy. Even after learning it I have to figure out how to reverse the issue with it.

If someone could help explain to me how to fix the reutrn bug or perhaps even handle the fix for me on a single map that'd be most appreciated. Thanks :D

TL;DR: I need someone to either explain to me how to fix the return bug or even better if someone could repair it for me. Much appreciated and thanks :D

I can't wait to get back to work on this map I've left in the dust.
 
the bug is usually with a function called "H2I" which is the only one i personally know how to fix, there's other ways to fix the other ones, though

The return bug was basically this
JASS:
function H2I takes handle h returns integer
return h
return 0
endfunction
Now, that's a little exploitation of the warcraft 3 code, as the syntax checker only checked the last value, 0, so it's true, but the game took the first value, h, and returned it. (handles have an id, usually along the lines of 10000)

now, basically, to fix it, do this
JASS:
function H2I takes handle h returns integer
     return GetHandleId(h)
endfunction
which is a new function blizzard added to do the same thing.

i hope this answered your question.
 
The return bug is not just H2I/I2H though. =) It is in general X2I and I2X where "X" is some variable type.

You should try to use Faux Handle Vars (located on wc3c.net) for easy replacements. It utilized it, not just for H2I though, so it just takes a while. You can easily replace them with hashtables though, and it will be fast if you didn't use a lot of them. (To be honest, usually people only save like 4-6 different variable types when using local handle vars, so it shouldn't be incredibly difficult to replace with hashtables)
 
Status
Not open for further replies.
Top