Uh well I just downloaded 2148 and I had read about the change in division in the main forums and so I assumed it was that. Hello bug!
Code:
int Test1 = 100;
int Test2 = 100/10;
int Test3 = (100/10);
int Test4 = (100/10)+1;
int Test5 = (100/10)+2;
int Test6a = 100/10;
int Test6b = Test6a+1;
float Test7 = 100/10;
float Test8 = (100/10)+1;
print( "100 = "+Test1);
print( "100/10 = "+Test2);
print( "(100/10) = "+Test3);
print( "(100/10)+1 = "+Test4);
print( "(100/10)+2 = "+Test5);
print( "Test6a+1 = "+Test6b);
print( "100/10 = "+Test7);
print( "(100/10)+1 = "+Test8);
Results in:
Code:
100 = 100
100/10 = 10
(100/10) = 10
(100/10)+1 = 1
(100/10)+2 = 2
Test6a+1 = 11
100/10 = 10.0
(100/10)+1 = 1.0
Script succeeded!
From this I conclude that theres something wrong with using "addition" on the same line where a division has taken place. (And also subtraction, "(100/10)-1 = -1)", oh and if you multiply instead of add you get "(100/10)*1 = 0", same with a second division "(100/10)/1 = 0".)
Eg the work around for now is to declare something like this:
Code:
int TempAmount = amountleft / 10;
int tobuy = TempAmount + 1 - item_amount( $item[knob goblin nasal spray]);
int touse = TempAmount + 1;
No promises on that there code though, since I'm basing my stuff off of "predetermined int values" but if it's the same bug then the above code should bypass it until a new release with the fix is made.
Edit: Wait 0_o So division in brackets causes that value to "default" to 0 if still has to be edited before being stored? ... Tries 1+(100/10) still 1+(100/10) = 1, but then it would still do the brackets first wouldn't it? Ahah true... >> Atleast we know it's following order of operations... *Removes brackets*... Yup "1+100/10 = 1", but then thats still doing the division first if its following order of operations...