Author: crab
Date: Thu Apr 16 01:52:37 2009
New Revision: 34956
URL: http://svn.gna.org/viewcvs/wesnoth?rev=34956&view=rev
Log:
Fixed segfault in ai grouping in the case that path length was <2
Modified:
trunk/src/ai/ai_move.cpp
Modified: trunk/src/ai/ai_move.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai/ai_move.cpp?rev=34956&r1=34955&r2=34956&view=diff
==============================================================================
--- trunk/src/ai/ai_move.cpp (original)
+++ trunk/src/ai/ai_move.cpp Thu Apr 16 01:52:37 2009
@@ -702,7 +702,7 @@
const double threat = power_projection(*i,enemy_dstsrc);
//FIXME: sukko doubled the power-projection them in the
second test. ?
if((threat >= double(best->second.hitpoints()) &&
threat > power_projection(*i,fullmove_dstsrc)) ||
- (i >= best_route.steps.end()-2 && unit_at_target !=
units_.end() && current_team().is_enemy(unit_at_target->second.side()))) {
+ (i+1 >= best_route.steps.end()-1 && unit_at_target
!= units_.end() && current_team().is_enemy(unit_at_target->second.side()))) {
dangerous = true;
break;
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits