• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Difficulty importing a spell

Status
Not open for further replies.
Level 2
Joined
May 10, 2019
Messages
18
Hi everyone,

I'm returning to the World Editor after a long leave of absence, and I'm having some difficulty orienting to all of the changes/updates. I'm attempting to import this spell into a different map: Organic Bomb v1.0.3 [vJASS][UPDATE]

When I open the original map with the spell and run "Validate test triggers" I receive an error: "Cannot convert returned value from integer to real."

The error is thrown on this function:

Code:
function CrazyIvan__Shift takes real r returns real
    if ( r < 120 ) then
        return 1.25
    elseif ( r < 300 ) and ( r > 119 ) then
        return 1.5
    elseif ( r < 450 ) and ( r > 299 ) then
        return 1.75
    elseif r > 449 then
        return 2
    endif
    return 1.4
endfunction

However, the original spell map allows me to test and use the spell without any issues.

By contrast, when I then try to import the spell into a different map, I receive the same error message but am unable to even test the map.

Any ideas why?
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
For further understanding: this type of 'return bug' was supported by the WE's syntax checker until patch 1.24b where it was removed because the return bug could be exploited to run arbitrary code on your machine. Now the syntax checker is rigid about return types and makes sure you are giving it the right thing to return instead of doing so blindly.
 
Level 2
Joined
May 10, 2019
Messages
18
For further understanding: this type of 'return bug' was supported by the WE's syntax checker until patch 1.24b where it was removed because the return bug could be exploited to run arbitrary code on your machine. Now the syntax checker is rigid about return types and makes sure you are giving it the right thing to return instead of doing so blindly.

Thanks, that helps because I'm having a hard time easing back into the World Editor now that those ancient bugs, like the Return Bug, have been fixed.
 
Status
Not open for further replies.
Top