← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/bug-1818073-worker into lp:widelands

 

All four are just bad coding style IMHO. Setting something to itself or doing += 0 is ugly, and empty conditional blocks and repetitive conditions should be avoided.

Suggestion:

if (amount > 0) {
    if (amount <= 2) {
        totalchance += 6;
    } else if (amount <= 4) {
        totalchance += 4;
    } else if (amount <= 6) {
        totalchance += 2;
    }
}
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1818073-worker/+merge/363851
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1818073-worker.


References