• 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.

[vJASS] Cannot convert integer to code?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
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