• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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

Status
Not open for further replies.
Level 9
Joined
Jun 13, 2008
Messages
362
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:
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+.
 
yeah I figured it out after a little bit of searching. I didnt know that 1.24 changed a lot of things.
 
Status
Not open for further replies.
Back
Top