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

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,468
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