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

Revision history for this message
Frank Pieper (frank-pieper-1) 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)?

ShallowWater could be passable for Ships and LandUnits.

« Back to merge proposal