• 🏆 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!

[JASS] How to fix "cannot convert from this type to that type" functions in the old spells?

Status
Not open for further replies.
Level 8
Joined
Jun 13, 2008
Messages
346
Hello,

I have an old spell which doesn't compile with the current version of jasshelper anymore.

it says that there are type mismatches in certain functions' return statements.

Code:
function H2I takes handle h returns integer
    return h
    return 0
endfunction
function I2H takes integer i returns handle
    return i
    return null
endfunction
function I2U takes integer i returns unit
    return i
    return null
endfunction
function I2G takes integer i returns group
    return i
    return null
endfunction
function I2E takes integer i returns effect
    return i
    return null
endfunction
function I2T takes integer i returns timer
    return i
    return null
endfunction

How can I fix this problem for my map to finally compile in the latest wc3 (1.32) ?

edit:fixed.
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,010
It sounds like you figured it out but those type of functions were deprecated in patch 1.24b some time ago because of security concerns. You can use GetHandleId() and hashtables now for what those functions used to do. Someone probably made a H2I return bug replacement library for compatibility in 1.24b+.
 
Status
Not open for further replies.
Top