From 8fc6cabf7d5028b3e332fcdacf8a4fde1c555c44 Mon Sep 17 00:00:00 2001 From: mattsc Date: Wed, 1 Jan 2020 19:12:37 -0800 Subject: [PATCH] Experimental AI: fix village_hunt CA bug This is really just a work around for a CA that is very much sub-par though. I will remove this CA from the ExpAI next. --- data/ai/lua/generic_rush_engine.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/ai/lua/generic_rush_engine.lua b/data/ai/lua/generic_rush_engine.lua index 47ec78e3ed14..761e68b89bb5 100644 --- a/data/ai/lua/generic_rush_engine.lua +++ b/data/ai/lua/generic_rush_engine.lua @@ -578,7 +578,7 @@ return { if target then local x, y = wesnoth.find_vacant_tile(target[1], target[2], unit) local dest = AH.next_hop(unit, x, y) - AH.checked_move(ai, unit, dest[1], dest[2]) + if dest then AH.checked_move(ai, unit, dest[1], dest[2]) end end end