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

boolean converted to (1) when compiling

Level 14
Joined
Oct 18, 2013
Messages
743
globals integer dosuPassCharges=0 integer DOSU_REASONATE_THRESHOLD = 35 endglobals function isReasonate takes nothing returns boolean return (dosuPassCharges >= DOSU_REASONATE_THRESHOLD) endfunction function dosuWupdate takes nothing returns boolean if isReasonate then return true endif return false endfunction

When I call this function further down in script, isReasonate gets compiled to (1), which throws "cannot convert int to bool"
 
Not sure why that's not allowed but the fix is simple:
vJASS:
function isReasonate takes nothing returns boolean
    local boolean b = false
    if dosuPassCharges >= DOSU_REASONATE_THRESHOLD then
        set b = true
    endif
    return b
endfunction

Or maybe it's because you forgot the parenthesis?
vJASS:
if isReasonate then
Should be:
vJASS:
if isReasonate() then
^ It's a function. Without the () it'll be looking for a variable with that name.

Also, I believe you meant to say "resonate" not "reasonate", although reasonate is a pretty cool word ;)
 
Last edited:
Back
Top