widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #00990
Re: [Merge] lp:~widelands-dev/widelands/bug995011 into lp:widelands
Well, this time certainly helped make the code a little neater, if only in a small detail. And it might also encourage people to read each other's code more, which could increase the bus count ;-)
I am going to change the const thing.
As for the variable declaration + assignment in the if clause: I actually like this pattern because it neatly puts the scope exactly where it makes the most sense. Can you explain what went wrong with refactoring?
CheckStepWalkOn used to be necessary because the code searched for buildings. Fields with buildings don't have MOVECAPS_WALK, so the only way the old code could ever have found any buildings at all is by allowing a special case exception on the last step of the search. Now that the code searches for flags, which are walkable by definition, this is no longer necessary.
Now that I think about it, this might also fix some weirdness in those already buggy cases when a military sites seals a narrow passage off completely: The findAttackSoldiers code may have decided that an attack in northwestern direction is possible (because it searches from the attackees flag and hits one of the fields of the military sites that seals passage), but when the attack is launched, the soldiers would fail to find a way. The new code guarantees that there is a path for the soldiers to follow.
--
https://code.launchpad.net/~widelands-dev/widelands/bug995011/+merge/147776
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug995011.
References