diff --git a/RELEASE_NOTES b/RELEASE_NOTES index cd2f9f44b8d..e3a5e7d6962 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -19,12 +19,13 @@ Example contents. [/rasection] -[rasection="Additions to the AI"] +[rasection="Additions and changes to the AI"] [list] [*]A new candidate action (CA), called [wiki=RCA_AI#The_Candidate_Actions_.28CAs.29_of_the_main_loop_Stage_in_the_RCA_AI]high XP attack[/wiki], has been added to all general Wesnoth AIs in mainline, fixing a short-coming in the default AI's combat CA. Previously, the AI would only attack units 1 experience point (XP) from leveling under very specific and rarely occurring circumstances. It was possible to exploit this, for example, for blocking vital passages or keeping key units alive without these units ever being attacked, making scenarios much easier than they were intended. The new CA fixes this hole and will generally, but not blindly, attack such units now. The attack logic is explained [url=https://github.com/wesnoth/wesnoth/blob/master/data/ai/lua/ca_high_xp_attack.lua#L5]here[/url]. Since the new behavior is accomplished not by changing the existing attack code, but by adding a new candidate action, the previous behavior can be restored by removing the high_xp_attack CA, in case this is desired in specific scenarios. [*]For content creators, a [wiki=Micro_AIs#Assassin_Squad_Micro_AI_.28ai_type.3Dassassin.29]new Micro AI[/wiki], controlling individual assassins or an entire assassin squad has been added. It is already being used in Heir to the Throne scenario 8, 'The Princess of Wesnoth'. +[*]A long standing bug which caused units with zero maximum moves not to attack adjacent enemies under certain circumstances has been fixed. This also (sometimes) affected units which could not move due to other circumstances (such as terrain). [/list] [/rasection] diff --git a/changelog b/changelog index 1792c9eed51..64a1354e536 100644 --- a/changelog +++ b/changelog @@ -4,6 +4,7 @@ Version 1.13.5+dev: attacks on enemy units so close to leveling that the default AI's combat CA would not attack them. * New Micro AI: Assassin Squad AI + * Fix bug #23720, AI units with max_moves=0 do not attack. * Campaigns: * Eastern Invasion: * Fixed broken village encounters. diff --git a/src/ai/default/attack.cpp b/src/ai/default/attack.cpp index e59218f08e8..a2845ba0fa6 100644 --- a/src/ai/default/attack.cpp +++ b/src/ai/default/attack.cpp @@ -304,7 +304,7 @@ double attack_analysis::rating(double aggression, const readonly_context& ai_obj } } - if(!leader_threat && vulnerability*terrain_quality > 0.0 && !is_surrounded) { + if(!leader_threat && vulnerability*terrain_quality > 0.0 && support != 0) { value *= support/(vulnerability*terrain_quality); }