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

[Snippet] BooleanExpression

Level 31
Joined
Jul 10, 2007
Messages
6,306
Updates

Added
method replace takes boolexpr expression returns nothing

Allowed adding null boolean expressions

Fixed a bug in the expression builder that was causing an infinite loop when the entire tree was empty/filled with nulls

edit
Also fixed the new replace method, I wasn't thinking when I added it in =), it works now

edit
Fixed another thing. Was destroying the added boolean expressions, which I shouldn't have been doing.
 
Last edited:
Level 31
Joined
Jul 10, 2007
Messages
6,306
Improved performance of the build method, meaning less operations are used

edit
Improved performance with null expressions. Null expressions are no longer included in the tree, only placeholders are kept. This means that they won't clutter the trigger, making the trigger as fast as possible.

edit
Fixed a bug I introduced in the new builder

Removed length, now just calculates length by iterating over list. Why? Because some nodes on the list may be null. Keep in mind that a list with 8 nodes may have like 511 functions, so calculating the length of the list is not a heavy operation.

edit
Fixed builder

edit
Fixed remove (forgot one check with the big change)
 
Last edited:
Top