• 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] Vexorian's BoolexprUtils

Unfortunately this small code snipped has been lost with wc3campains.net downfall.

So if someone is looking for it ^^

System: BoolexpUtils
Author: Vexorian
Usage: a little of memory saving if you use True/False conditions often.

JASS:
library BoolexprUtils initializer init
    globals
        boolexpr BOOLEXPR_TRUE=null
        boolexpr BOOLEXPR_FALSE=null
    endglobals

    private function rettrue takes nothing returns boolean
        return true
    endfunction

    private function retfalse takes nothing returns boolean
        return false
    endfunction

    private function init takes nothing returns nothing
        set BOOLEXPR_TRUE=Condition(function rettrue)
        set BOOLEXPR_FALSE=Condition(function retfalse)
    endfunction
endlibrary
 
The "return true/false" thing was primarily useful during the times when a boolexpr would somehow leak if "null" was used instead of RETURN_TRUE. I am not sure if RETURN_FALSE was ever used, as it was only intended for API filler. The two constants were incorporated into GroupUtils and I would consider them wholly deprecated.
 
The "return true/false" thing was primarily useful during the times when a boolexpr would somehow leak if "null" was used instead of RETURN_TRUE. I am not sure if RETURN_FALSE was ever used, as it was only intended for API filler. The two constants were incorporated into GroupUtils and I would consider them wholly deprecated.
Thanks for the feedback, and sorry for the flood 😅
 
Top