Quote:
Originally Posted by Hepatitis C
It does not need to be else if.
Mine is "if" and it works perfectly.
|
very minor and I'm sure most people know this but for those who don't.
If statements function in a logical pattern.
if
- if something then something. ONLY ONE or else all are valid
else if
- if first if didn't go off, the else can still happen. Can have lots of these in a row
else
- if none of the previous if/else if's were triggered else is triggered.
I have never looked at this new source so I don't know how that file is structured but just use some common sense. If you use an if in between a long list of else if's then you will break it up into 2 separate sections
Eg:
if x > 1
do x
if x > 2
do y
if x is under 1 then NEITHER go off
if x = 2 x happens
if x = 3 or more x AND y happens
Eg 2:
if x > 1
do x
else if x > 2
do y
else if x > 0
do z
again, x = 2 x happens
x >= 3 x happens (NOT X AND Y BECAUSE IT'S AN ELSE IF) In this case Y will never happen, nor will z.
So if in the existing source you have a logical flow of
if
else if
else if
else if
else
if you were to place a new if command somewhere in the else if statements, you will separate the flow of logic into 2 distinct sections causing new (sometimes odd things) to happen to your drop rate.
Anyways, not directed at anyone in particular, just figured I'd offer a small warning on when to use if/else if statements.