Code review comment for lp:~widelands-dev/widelands/bug543113

Revision history for this message
Shevonar (shevonar) wrote :

Instead of your nested if and else statement you can use just two if statement.

if ((fc.field->nodecaps() & ~MOVECAPS_SWIM) and ((fc.field->nodecaps() & MOVECAPS_WALK) or fc.field->get_immovable())) {
    m_land_size_total++;
    if (Player_Number const owner = fc.field->get_owned_by())
        ++land_size[owner - 1];
}

Is it even necessary to check if the field is not "swimmable"? Can a field be walkable and swimmable (I don't think so) or swimmable and have and immovable (I am not sure about that)?

review: Needs Fixing

« Back to merge proposal