From 9fc0c72e713d8dbbe92989807558e33e0f0d029e Mon Sep 17 00:00:00 2001
From: Allanis <allanis@saracraft.net>
Date: Sun, 24 Feb 2013 15:53:36 +0000
Subject: [PATCH] [Add] If you don't kill the merchant so soon, It will attempt
 to jump hyperspace when running away.

---
 scripts/ai/merchant.lua | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/ai/merchant.lua b/scripts/ai/merchant.lua
index 681f74a..3f45a4e 100644
--- a/scripts/ai/merchant.lua
+++ b/scripts/ai/merchant.lua
@@ -6,6 +6,10 @@ function control()
 	task = ai.taskname()
 	if task == "hyperspace" then
 		ai.hyperspace() -- Try to go to hyperspace.
+	elseif task == "runaway" then
+		if ai.dist(is.pos(ai.targetid())) > 300 then
+			ai.hyperspace()
+		end
 	elseif task == "none" then
     planet = ai.rndplanet()
     ai.pushtask(0, "go", planet)