← Back to team overview

widelands-dev team mailing list archive

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

 

We want it to be 0 right? I just reverted to how it was in r8823.

Yours did set it to 4 as hessenfarmer said, 4 ways to fix it:

(1)

if (amount != 0 && amount <= 2) {
    totalchance += 6;
} else if (amount != 0 && amount <= 4) {
    totalchance += 4;
} else if (amount != 0 && amount <= 6) {
    totalchance += 2;
}


(2)

if (amount == 0) {
    totalchance = totalchance;
} else if (amount <= 2) {
    totalchance += 6;
} else if (amount != 0 && amount <= 4) {
    totalchance += 4;
} else if (amount != 0 && amount <= 6) {
    totalchance += 2;
}

(3)
if (amount == 0) {
    totalchance = 0;
} else if (amount <= 2) {
    totalchance += 6;
} else if (amount != 0 && amount <= 4) {
    totalchance += 4;
} else if (amount != 0 && amount <= 6) {
    totalchance += 2;
}

(4)

if (amount == 0) {
    // don't do nothing 
} else if (amount <= 2) {
    totalchance += 6;
} else if (amount != 0 && amount <= 4) {
    totalchance += 4;
} else if (amount != 0 && 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