Author: esr
Date: Fri Dec 5 13:51:02 2008
New Revision: 31282
URL: http://svn.gna.org/viewcvs/wesnoth?rev=31282&view=rev
Log:
Address bug #12632 (Reproducible pathfinding crash) by backing out yet another
suokko change it turns out I shouldn't have merged. Sigh...
Modified:
trunk/src/ai.cpp
trunk/src/ai_move.cpp
Modified: trunk/src/ai.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai.cpp?rev=31282&r1=31281&r2=31282&view=diff
==============================================================================
--- trunk/src/ai.cpp (original)
+++ trunk/src/ai.cpp Fri Dec 5 13:51:02 2008
@@ -1209,7 +1209,6 @@
std::vector<attack_analysis>::iterator choice_it = analysis.end();
double choice_rating = -1000.0;
- double vuln = 0.0;
for(std::vector<attack_analysis>::iterator it = analysis.begin();
it != analysis.end(); ++it) {
@@ -1233,7 +1232,6 @@
if(rating > choice_rating) {
choice_it = it;
choice_rating = rating;
- vuln = it->vulnerability/it->support;
}
}
@@ -1258,9 +1256,6 @@
<< from << '\n';
return true;
}
-
- if (vuln > 1.5)
- add_target(target(to, vuln,target::SUPPORT));
// Recalc appropriate weapons here: AI uses approximations.
battle_context bc(map_, teams_, units_, state_,
Modified: trunk/src/ai_move.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai_move.cpp?rev=31282&r1=31281&r2=31282&view=diff
==============================================================================
--- trunk/src/ai_move.cpp (original)
+++ trunk/src/ai_move.cpp Fri Dec 5 13:51:02 2008
@@ -553,11 +553,7 @@
raise_user_interact();
const move_cost_calculator calc(u->second, map_,
units_, u->first, dstsrc, enemy_dstsrc);
- // FIXME: should be set to
- // std::min(best_target->value / best_rating, 100.0);
- // but that causes an essertion failure. See
- // bug #12632.
- const double locStopValue = 500.00;
+ const double locStopValue = std::min(best_target->value
/ best_rating, 100.0);
paths::route cur_route = a_star_search(u->first,
best_target->loc, locStopValue, &calc, map_.w(), map_.h());
if (cur_route.move_left < locStopValue)
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits