SRL Archive - Bugs

Calculation always evaluates to False at line...


putonajonny

2012-01-21 06:04:38

Warning When Compiling:
Calculation always evaluates to False at line 334


Line 334
  Until(((PickAxeInInvent) and (InvCount = 1)) or ((not PickAxeInInvent) and (InvEmpty)))  

It obviously doesn't always evaluate to false as it would get stuck in that repeat loop, which it doesn't.

PickAxeInInvent is a constant defined by the user at the start of the script.

mormonman

2012-01-21 06:20:17

Set a global variable each time a new player is logged in for the inventory count. If a player has pickaxe in inventory then make the count 1 else count 0.

putonajonny

2012-01-21 06:23:23

So like
Players[0].Booleans[0] := False;      //Pickaxe in invent?
?

Flight

2012-01-21 06:35:08

I would just do this:

repeat
FindNormalRandoms;

if (PickAxeInInvent and (InvCount = 1)) then
break;

if ((not PickAxeInInvent) and (InvEmpty)) then
break;
until(false)

Of course you create an infinite loop here, but inside you could put a timer check if you really wanted to.

putonajonny

2012-01-21 09:54:42

From: Flight
I would just do this:

repeat
FindNormalRandoms;

if (PickAxeInInvent and (InvCount = 1)) then
break;

if ((not PickAxeInInvent) and (InvEmpty)) then
break;
until(false)

Of course you create an infinite loop here, but inside you could put a timer check if you really wanted to.


There was a timer check within the loop but yeah that looks the best way.