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

[vJASS] Cannot convert integer to code?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,337
Hi,

I am getting this error from this section of the library:

JASS:
private function enum takes nothing returns nothing
	set count = count + 1
endfunction


private function isLocReachable takes location whichLoc, real range returns boolean
	set count = 0
	call EnumDestructablesInCircleBJ(range, whichLoc, enum)
	if count > 0 then
		return false
	endif
	return true
endfunction

When jasshelper comes up, it has apparently converted the function enum into a constant integer?

JASS:
function RandomLoc___enum takes nothing returns nothing
	set RandomLoc___count=RandomLoc___count + 1
endfunction


function RandomLoc___isLocReachable takes location whichLoc,real range returns boolean
	set RandomLoc___count=0
	call EnumDestructablesInCircleBJ(range, whichLoc, (1))
	if RandomLoc___count > 0 then
		return false
	endif
	return true
endfunction

How do I fix this so it works as expected?
 
Status
Not open for further replies.
Top