(svn r13422) [NoAI] -Change [API CHANGE]: remove Stop() as part of the AIController. This means you no longer need to have a Stop() function in your AI, nor is it ever called. This because it was silly, never used, and couldn't do anything real (all Sleep/DoCommands resulted in an assert, as the game expected the company to be gone). noai
authortruebrain
Sun, 08 Jun 2008 21:20:48 +0000
branchnoai
changeset 10871 326ee226e9d7
parent 10870 20b6cff3d6b2
child 10872 b0495ab6c5cd
(svn r13422) [NoAI] -Change [API CHANGE]: remove Stop() as part of the AIController. This means you no longer need to have a Stop() function in your AI, nor is it ever called. This because it was silly, never used, and couldn't do anything real (all Sleep/DoCommands resulted in an assert, as the game expected the company to be gone).
bin/ai/regression/regression.nut
bin/ai/wrightai/main.nut
src/ai/ai_threads.cpp
src/ai/api/ai_controller.cpp
src/ai/api/ai_controller.hpp
--- a/bin/ai/regression/regression.nut	Sun Jun 08 21:11:05 2008 +0000
+++ b/bin/ai/regression/regression.nut	Sun Jun 08 21:20:48 2008 +0000
@@ -1,8 +1,5 @@
 class Regression extends AIController {
-	stop     = false;
-
 	function Start();
-	function Stop();
 }
 
 
@@ -1327,8 +1324,3 @@
 	print("  IsEventWaiting:        false");
 }
 
-function Regression::Stop()
-{
-	this.stop = true;
-}
-
--- a/bin/ai/wrightai/main.nut	Sun Jun 08 21:11:05 2008 +0000
+++ b/bin/ai/wrightai/main.nut	Sun Jun 08 21:20:48 2008 +0000
@@ -10,7 +10,6 @@
 	passenger_cargo_id = -1;
 
 	function Start();
-	function Stop();
 
 	constructor() {
 		this.towns_used = AIList();
@@ -384,7 +383,3 @@
 	}
 }
 
-function WrightAI::Stop()
-{
-}
-
--- a/src/ai/ai_threads.cpp	Sun Jun 08 21:11:05 2008 +0000
+++ b/src/ai/ai_threads.cpp	Sun Jun 08 21:20:48 2008 +0000
@@ -111,9 +111,6 @@
 
 		/* The main fiber wants this AI to die */
 		if (this->state == STOPPING) {
-			/* Inform the controller */
-			this->controller->Stop();
-
 			/* Suspend, and exit */
 			this->state = SUSPENDED;
 			this->Exit();
--- a/src/ai/api/ai_controller.cpp	Sun Jun 08 21:11:05 2008 +0000
+++ b/src/ai/api/ai_controller.cpp	Sun Jun 08 21:20:48 2008 +0000
@@ -177,11 +177,6 @@
 	if (this->engine != NULL) this->engine->CallMethod(*this->SQ_instance, "Start");
 }
 
-void AIController::Stop()
-{
-	if (this->engine != NULL) this->engine->CallMethod(*this->SQ_instance, "Stop");
-}
-
 AIController::~AIController()
 {
 	if (this->engine != NULL) delete this->engine;
--- a/src/ai/api/ai_controller.hpp	Sun Jun 08 21:11:05 2008 +0000
+++ b/src/ai/api/ai_controller.hpp	Sun Jun 08 21:20:48 2008 +0000
@@ -38,14 +38,6 @@
 	void Start();
 
 	/**
-	 * When this function is called, the AI must stop as soon as possible.
-	 *   It may not call any function that might suspend, like DoCommand()
-	 *   and Sleep().
-	 * @note Cannot be called from within your AI.
-	 */
-	void Stop();
-
-	/**
 	 * Increase the internal ticker. You should never call this yourself,
 	 *   as it is called by the OpenTTD system itself.
 	 * @note Cannot be called from within your AI.