Merge lp:~widelands-dev/widelands/bug-1388028 into lp:widelands
Proposed by
GunChleoc
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 7240 | ||||
Proposed branch: | lp:~widelands-dev/widelands/bug-1388028 | ||||
Merge into: | lp:widelands | ||||
Diff against target: |
62 lines (+24/-12) 1 file modified
src/ai/defaultai.cc (+24/-12) |
||||
To merge this branch: | bzr merge lp:~widelands-dev/widelands/bug-1388028 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
TiborB | Pending | ||
Review via email: mp+240357@code.launchpad.net |
Description of the change
Fixed division by zero in AI that can come up when loading a savegame.
@Tibor: could you please make sure that this is still intended behaviour for the AI and remove the NOCOM comments when you're done?
To post a comment you must log in.
GunChleoc - this is not about zero division but about out-of-range - I think.
Do you think that problem is that genstats is not populated some very short time after loading and AI tries to access members that are not there yet? So that genstats.size()==0?
If this is the case I would use other aproach then try-catch...
Also see comments in diff, default decision for AI if it can not get data on military strength of enemy should be 'do not attack'