• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

[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