mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-01 21:15:38 +00:00
prevent all AI from attacking twice with the same unit
This commit is contained in:
parent
6c166bce87
commit
6d1dc0f2b5
@ -160,6 +160,7 @@ SVN trunk (1.1.1+svn):
|
||||
* force a refresh after calls to ONSCREEN scrolls, to avoid refresh
|
||||
problems.
|
||||
* add sort_topics command to the WML of help
|
||||
* check in ai code that ai doesn't use the same unit to attack twice
|
||||
|
||||
Version 1.1.1:
|
||||
* campaigns
|
||||
|
@ -1006,6 +1006,10 @@ void ai_interface::attack_enemy(const location& u, const location& target, int w
|
||||
LOG_STREAM(err, ai) << "attempt to attack unit that is turned to stone\n";
|
||||
return;
|
||||
}
|
||||
if(!info_.units.find(u)->second.can_attack()) {
|
||||
LOG_STREAM(err, ai) << "attempt to attack twice with the same unit\n";
|
||||
return;
|
||||
}
|
||||
|
||||
recorder.add_attack(u,target,weapon);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user