How To Convert To 1.24b
This tutorial will teach you how to convert all of your resources to 1.24b, the newest (at the time of this tutorial) patch.
As most people know, this patch sucks. It broke almost all of the existing systems and maps, including DotA.
Update
Update any systems that have been updated by their creators to work with 1.24b.
Chances are, the system creators fixed the bug better than you did.
Return Bug
Find any thing that has two returns right after each other. An example:
This is the famous "return bug" that converts a handle to an integer, effectively getting its ID. (And many other variations like I2U, U2I, I2T, T2I etc)
Note, as of 1.24b there is only one way to fix the above typecasting. And it's only for H2I and S2I. GetHandleId and StringHash respectively.
The DoNothing trick no longer working. Typecasting integers (handle id's) back to handles no longer works. You'll have to fix the return bug with GetHandleId now, no other return bugs work, except S2I.
Now, how to work around the return bug not working anymore? Hashtables. Store it something like: Parent(PlayerId), Child(SomeInteger) and retrieve the same way.
H2I/GetHandleId
Replace parts of H2I to return the native instead:
becomes
JassHelper will turn this:
into:
Via inlining.
And that's about it for the return bug
Else Return Bug
As of 1.24b, there are no more false positives on this. (There shouldn't be, at least.) However, it's still safe to follow your good sense and try to avoid these situations.
Conclusion
Congratulations! Your map is 1.24b compatible!
Or, not. And you failed somewhere. (There aren't many places you can screw up anymore >_>) Start at the beginning again.
If anyone finds anything new that pops up and needs fixing, post here so I can add it/fix it
How To Convert To 1.24b
By: Sevion
By: Sevion
This tutorial will teach you how to convert all of your resources to 1.24b, the newest (at the time of this tutorial) patch.
As most people know, this patch sucks. It broke almost all of the existing systems and maps, including DotA.
Update
Update any systems that have been updated by their creators to work with 1.24b.
Chances are, the system creators fixed the bug better than you did.
Return Bug
Find any thing that has two returns right after each other. An example:
JASS:
return 0.
return 1.
This is the famous "return bug" that converts a handle to an integer, effectively getting its ID. (And many other variations like I2U, U2I, I2T, T2I etc)
Note, as of 1.24b there is only one way to fix the above typecasting. And it's only for H2I and S2I. GetHandleId and StringHash respectively.
The DoNothing trick no longer working. Typecasting integers (handle id's) back to handles no longer works. You'll have to fix the return bug with GetHandleId now, no other return bugs work, except S2I.
Now, how to work around the return bug not working anymore? Hashtables. Store it something like: Parent(PlayerId), Child(SomeInteger) and retrieve the same way.
H2I/GetHandleId
Replace parts of H2I to return the native instead:
JASS:
function H2I takes handle h returns integer
return h
//call DoNothing() <-- Probably won't be in peoples' maps, but just in case it is, so you don't go "OMG? WHERE R H2I???" <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue :p" loading="lazy" data-shortname=":p" />
return 0
endfunction
becomes
JASS:
function H2I takes handle h returns integer
return GetHandleId(h)
endfunction
JassHelper will turn this:
JASS:
local integer i = H2I(GetTriggerUnit())
into:
JASS:
local integer i = GetHandleId(GetTriggerUnit())
Via inlining.
And that's about it for the return bug
Else Return Bug
As of 1.24b, there are no more false positives on this. (There shouldn't be, at least.) However, it's still safe to follow your good sense and try to avoid these situations.
Conclusion
Congratulations! Your map is 1.24b compatible!
Or, not. And you failed somewhere. (There aren't many places you can screw up anymore >_>) Start at the beginning again.
If anyone finds anything new that pops up and needs fixing, post here so I can add it/fix it