• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Help with map and return bug fix

Status
Not open for further replies.
Level 13
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