Merge lp:~janosch-peters-deactivatedaccount/widelands/bugfix_1395238 into lp:widelands
Proposed by
xxx-deleted
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 7687 | ||||||||
Proposed branch: | lp:~janosch-peters-deactivatedaccount/widelands/bugfix_1395238 | ||||||||
Merge into: | lp:widelands | ||||||||
Diff against target: |
183 lines (+37/-19) 4 files modified
src/logic/bob.cc (+8/-6) src/logic/bob.h (+2/-1) src/logic/soldier.cc (+22/-10) src/logic/soldier.h (+5/-2) |
||||||||
To merge this branch: | bzr merge lp:~janosch-peters-deactivatedaccount/widelands/bugfix_1395238 | ||||||||
Related bugs: |
|
Description of the change
Fix for Bug #1395238: Soldiers now recognize when they are stuck. If they are, they walk along their path without honoring blocked nodes (e.g. they just walk through other soldiers).
This is also a fix for Bug #1522290 (as this bug is caused by #1395238).
To test this fix load the savegame attached in #1522290 and verify that the soldiers return home (they are not stuck anymore).
To post a comment you must log in.
I couldn't test if this works, but the code seems OK. Just one code style nit: We are moving away from using defines and using constexpr instead. So, instead of
#define BLOCK_COUNT_ IS_STUCK 10
it would be better to use something like:
constexpr int kBlockCountIsStuck = 10;
The type should match state.ivar3.