Welcome Guest [Log In] [Register]
Welcome to Clan SKoD. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Patch 1.24; JASS Bug Fixes
Topic Started: Aug 5 2009, 06:09 PM (293 Views)
Garn
Member Avatar
"Teeth"
On Tuesday, August 04th, 2009, Blizzard released patch 1.24, which fixed several 'bugs' dealing with the JASS programming script. These 'fixes' leave some of the maps on Battle.net now unplayable.

Among them:
- DotA ( Latest)
- EoTA: Exodus
- WoW Arena (Bugs)
"Greetings to you. I am Edwin Odesseiron, but you simians may refer to me merely as 'sir' for a less... syllable-intensive workout." -Edwin Odessiron, Red Mage of Thay
Posted ImagePosted Image

Posted Image
"Go for the eyes, Boo! GO FOR THE EYES!! RAAAAGHH!!!"
"What? My weapon has no effect? I need a bigger sword!"
"Magic is impressive, but now MINSC leads! Swords for EVERYONE!" -Minsc, Ranger
Offline Profile Quote Post Goto Top
 
Jassu
Member Avatar
Cloughb Lawd
http://www.wc3c.net/showthread.php?t=107034&page=1

The patch that was supposed to fix the return bug did not fix it properly. Some maps that use the return bug are still working. Some maps that don't use the return bug are not working.

Example of the return bug:

function H2I takes handle h returns integer
return h
return 0
endfunction

You're only allowed to return one value at the end of the function, but the bug allows you to do otherwise.

Of course, there's a problem with it. You can still use the return bug. Example:

function H2I takes handle h returns integer
return h
call DoNothing()
return 0
endfunction

The word "return" acts as a break line, per se. It tells the game to skip remaining actions in the function. Normally, you get a syntax error if you try to return two values in the function, but sticking a function call in between the two returns gives the game stuff to "skip" (because of the return line), allowing you to have the extra return line. Even though the rest of the actions are skipped, the game still recognizes both returns, so you're still returning both values, allowing you to arbitrarily type cast handles as integers and store them in the game cache.

Note: A handle cannot be converted to an integer by normal methods. Blizzard implemented a new native called GetHandleId(), which allows you to get the integer id of a handle and store that in the new game cache (hashtable).

Note2: The function DoNothing() is a Blizzard.j function. It looks like this:

function DoNothing takes nothing returns nothing
endfunction

So you're not really doing anything with the function call to cheat the syntax checker. Continuing with the rest of the explanation.

Example of something not using the return bug that is breaking:

function test takes nothing returns boolean
if false then
return false
elseif false then
endif
return false
endfunction

The syntax checker is picking up false positives because you're using "return" more than once in the function. With an if/then/else statement, you're allowed to return multiple values, but only one value per condition.

Example of something similar that works:

function test takes nothing returns boolean
if false then
return false
endif
if false then
endif
return true
endfunction

The problem seems to be the "elseif" statement. The syntax checker is registering that as some sort of workaround the "fix" to the bug. However, if you stick a "return false" line after the "elseif false then" line, it works. Not sure how that makes sense at all. : \

Example:

function test takes nothing returns boolean
if false then
return false
elseif false then
return false
endif
return false
endfunction

That function will compile. Not sure how the syntax checker is returning false positives with the elseif statements.
Posted Image
function checkSymbol takes nothing returns nothing
local integer i = 0
local symbol s = 
if SymbolViewability(s) == false then
loop
exitwhen i == 4294967296
call UserAnimationLaughingAt(GetOwningUser(GetUserSig()), GetViewingUser())
set i = i + 1
endloop
else
call UserAddRep(GetOwningUser(GetUserSig()), GetViewingUser(), 5)
endif
endfunction
Offline Profile Quote Post Goto Top
 
« Previous Topic · Off Topic · Next Topic »
Add Reply