In DefaultAI::update_mineable_field: is the code "++field.mines_nearby;" really reachable?

Asked by Sigra on 2010-05-23

See DefaultAI::update_mineable_field at [http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/annotate/head:/src/ai/defaultai.cc#L625]. It seems to check if a node has a building (http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/annotate/head:/src/ai/defaultai.cc#L652) and then if the player can build a mine there (http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/annotate/head:/src/ai/defaultai.cc#L653). But can it ever be allowed to build a mine on an existing building? If not, the code that is inside both of those if-statements is unreachable.

Question information

Language:
English Edit question
Status:
Answered
For:
widelands Edit question
Assignee:
No assignee Edit question
Last query:
2010-05-23
Last reply:
2010-05-23
Nasenbaer (nasenbaer) said : #1

in fact, this should be a check of get_ismine() instead. You are of course right here - I will fix this.

Nasenbaer (nasenbaer) said : #2

Committed a fix in rev. 5356

Can you help with this problem?

Provide an answer of your own, or ask Sigra for more information if necessary.

To post a message you must log in.