From 71129e5caeb18402115ad6838f300453635d05f2 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Wed, 15 May 2013 21:08:29 +0000
Subject: [PATCH] Huge Sandworm Tunneler will try very very hard to get to the
 exit. It truly is relentless !

git-svn-id: http://svn.net-core.org/repos/t-engine4@6715 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/ai/sandworm_tunneler.lua | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/game/modules/tome/ai/sandworm_tunneler.lua b/game/modules/tome/ai/sandworm_tunneler.lua
index 3e7e44a02f..5009ab45e9 100644
--- a/game/modules/tome/ai/sandworm_tunneler.lua
+++ b/game/modules/tome/ai/sandworm_tunneler.lua
@@ -119,9 +119,15 @@ newAI("sandworm_tunneler_huge", function(self)
 		self.ai_state.next_spot = self.ai_state.next_spot + 1
 		local s = game.level.ordered_spots[self.ai_state.next_spot]
 		if not s then
-			game.logSeen(self, "#OLIVE_DRAB#The %s burrows into the ground and disappears.", self.name)
-			self:disappear()
-			return
+			local ls = game.level.ordered_spots[#game.level.ordered_spots]
+			if self.x == ls.x and self.y == ls.y then
+				game.logSeen(self, "#OLIVE_DRAB#The %s burrows into the ground and disappears.", self.name)
+				self:disappear()
+				return
+			else -- Relentlessly try to get to the end
+				self.ai_state.next_spot = #game.level.ordered_spots
+				s = ls
+			end
 		end
 		self.ai_state.spot_x = s.x
 		self.ai_state.spot_y = s.y
-- 
GitLab