Check min and max to determine truth value of condition

Also added some min/max values for a few functions.

This allows optimizing things like:

  ! llGetNumberOfPrims()  ->  0
This commit is contained in:
Sei Lisa 2019-01-06 23:49:33 +01:00
parent 5bfb218505
commit 1b3c8a4d89
4 changed files with 42 additions and 6 deletions

View file

@ -4,7 +4,10 @@ if (llSameGroup(llGetOwner()) && llDetectedGroup(0)) llDie();
// TODO
// llGetEnergy() has min=0 and max=1, therefore (integer)llGetEnergy() is bool,
// however we don't yet handle it.
// however we don't handle it yet (needs min and max applied to expressions).
if ((integer)llGetEnergy() && llSameGroup(llGetOwner())) llDie();
// Check that min and max work as they should. This is always true.
if (llGetNumberOfPrims()) llDie();
}}