12-31-2014, 11:30 PM
You should really use blocks for statements that use the same conditions. Like this:
Do:
Don't:
I'll look through your code more thoroughly later, but right now, just work on cleaning it up.
Do:
Code:
if(condition1){
statement;
statement;
statement;
};
if(condition2){
statement;
statement;
statement;
};
Don't:
Code:
if(condition1)
statement;
if(condition1)
statement;
if(condition1)
statement;
if(condition2)
statement;
I'll look through your code more thoroughly later, but right now, just work on cleaning it up.