Project

General

Profile

Bug #239 » 0027-mapgenerator4-Fix-CodeQL-bad-oddness-check-warning.patch

S3_2, S3_1 - Marko Lindqvist, 02/08/2024 04:39 AM

View differences:

server/generator/mapgen.c
initworld(pstate);
i = player_count() / 2;
if ((player_count() % 2) == 1) {
make_island(bigweight * 3 * pstate->totalmass / totalweight, 3,
pstate, DMSIS);
if ((player_count() & 1) == 1) {
make_island(bigweight * 3 * pstate->totalmass / totalweight, 3,
pstate, DMSIS);
} else {
i++;
}
while ((--i) > 0) {
make_island(bigweight * 2 * pstate->totalmass / totalweight, 2,
pstate, DMSIS);
pstate, DMSIS);
}
for (i = player_count(); i > 0; i--) {
make_island(20 * pstate->totalmass / totalweight, 0, pstate, DMSIS);
(2-2/2)