Coming back to the game after a long time only to find that Castle Fight v1.13b only runs on versions around 1.20. Trying to port it to newer versions but JassHelper reports "Cannot convert returned value from integer to unit" for function WD. Relevant code snippet below.
The code seems to be cooking something like a unit linked list using unit custom value. I'm not sure if this is the last thing that's preventing newer versions of the game from loading the map, but it is the last error JassHelper prints out when I fixed other double return issues (using GetHandleId).
This was probably already discussed in one thousand other posts, but I can't for the life of me find much relevant info regarding porting broken old maps, especially regarding this particular error. It would be great if anyone can share some pointers for this poor old mapster!
The code seems to be cooking something like a unit linked list using unit custom value. I'm not sure if this is the last thing that's preventing newer versions of the game from loading the map, but it is the last error JassHelper prints out when I fixed other double return issues (using GetHandleId).
This was probably already discussed in one thousand other posts, but I can't for the life of me find much relevant info regarding porting broken old maps, especially regarding this particular error. It would be great if anyone can share some pointers for this poor old mapster!
JASS:
function WD takes integer WE returns unit
return WE
return null
endfunction
function V9 takes unit R6 returns integer
return R6
return 0
function ZN takes unit TR,integer ZO,real S8,real ZP,real ZQ returns nothing
local unit u=TR
local unit e
if GetUnitAbilityLevel(u,'A07E')==0 then
call UnitAddAbility(u,'A07E')
endif
loop
exitwhen GetUnitUserData(u)==0
exitwhen WD(GetUnitUserData(u))==null
set u=WD(GetUnitUserData(u))
endloop
set e=CreateUnit(GetOwningPlayer(TR),ZO,GetUnitX(TR)+ZP,GetUnitY(TR)+ZQ,S8)
call SetUnitPathing(e,false)
call SetUnitX(e,GetUnitX(TR)+ZP)
call SetUnitY(e,GetUnitY(TR)+ZQ)
call SetUnitUserData(u,V9(e))
endfunction