summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-12-21 21:50:46 +0000
committerrubidium <rubidium@openttd.org>2007-12-21 21:50:46 +0000
commit766551b0bcef873cf1c27e502506f4eef735e9e9 (patch)
treed864de233dd5965735564d85017cf7abf0875933 /src/ai
parenta122971ae297d1bca76f2518b7c814b1e162f52f (diff)
downloadopenttd-766551b0bcef873cf1c27e502506f4eef735e9e9.tar.xz
(svn r11677) -Codechange: move price and command related types/functions to their respective places.
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/ai.cpp12
-rw-r--r--src/ai/ai.h4
-rw-r--r--src/ai/default/default.cpp3
-rw-r--r--src/ai/trolly/build.cpp2
-rw-r--r--src/ai/trolly/pathfinder.cpp2
-rw-r--r--src/ai/trolly/trolly.cpp2
6 files changed, 10 insertions, 15 deletions
diff --git a/src/ai/ai.cpp b/src/ai/ai.cpp
index 1f85fc981..3a4a435a1 100644
--- a/src/ai/ai.cpp
+++ b/src/ai/ai.cpp
@@ -3,7 +3,7 @@
#include "../stdafx.h"
#include "../openttd.h"
#include "../variables.h"
-#include "../command.h"
+#include "../command_func.h"
#include "../network/network.h"
#include "../helpers.hpp"
#include "ai.h"
@@ -45,7 +45,7 @@ static void AI_DequeueCommands(PlayerID player)
* Needed for SP; we need to delay DoCommand with 1 tick, because else events
* will make infinite loops (AIScript).
*/
-static void AI_PutCommandInQueue(PlayerID player, TileIndex tile, uint32 p1, uint32 p2, uint procc, CommandCallback* callback)
+static void AI_PutCommandInQueue(PlayerID player, TileIndex tile, uint32 p1, uint32 p2, uint32 procc, CommandCallback* callback)
{
AICommand *com;
@@ -81,7 +81,7 @@ static void AI_PutCommandInQueue(PlayerID player, TileIndex tile, uint32 p1, uin
/**
* Executes a raw DoCommand for the AI.
*/
-CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc, CommandCallback* callback)
+CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32 procc, CommandCallback* callback)
{
PlayerID old_lp;
CommandCost res;
@@ -104,10 +104,6 @@ CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, u
/* Restore _cmd_text */
_cmd_text = tmp_cmdtext;
- /* If we did a DC_EXEC, and the command did not return an error, execute it
- * over the network */
- if (flags & DC_NO_WATER) procc |= CMD_NO_WATER;
-
/* NetworkSend_Command needs _local_player to be set correctly, so
* adjust it, and put it back right after the function */
old_lp = _local_player;
@@ -134,7 +130,7 @@ CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, u
}
-CommandCost AI_DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc)
+CommandCost AI_DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32 procc)
{
return AI_DoCommandCc(tile, p1, p2, flags, procc, NULL);
}
diff --git a/src/ai/ai.h b/src/ai/ai.h
index 57f198eb9..081d3e969 100644
--- a/src/ai/ai.h
+++ b/src/ai/ai.h
@@ -6,7 +6,7 @@
#include "../functions.h"
#include "../network/network.h"
#include "../player.h"
-#include "../command.h"
+#include "../command_type.h"
/* How DoCommands look like for an AI */
struct AICommand {
@@ -14,7 +14,7 @@ struct AICommand {
uint32 p1;
uint32 p2;
uint32 procc;
- CommandCallback* callback;
+ CommandCallback *callback;
char *text;
uint uid;
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp
index ca6fe55c4..1b18f27e4 100644
--- a/src/ai/default/default.cpp
+++ b/src/ai/default/default.cpp
@@ -15,12 +15,11 @@
#include "../../tunnel_map.h"
#include "../../vehicle.h"
#include "../../engine.h"
-#include "../../command.h"
+#include "../../command_func.h"
#include "../../town.h"
#include "../../industry.h"
#include "../../station.h"
#include "../../pathfind.h"
-#include "../../economy.h"
#include "../../airport.h"
#include "../../depot.h"
#include "../../variables.h"
diff --git a/src/ai/trolly/build.cpp b/src/ai/trolly/build.cpp
index a83ccb5a2..53bf9b782 100644
--- a/src/ai/trolly/build.cpp
+++ b/src/ai/trolly/build.cpp
@@ -7,7 +7,7 @@
#include "../../map.h"
#include "../../road_map.h"
#include "../../vehicle.h"
-#include "../../command.h"
+#include "../../command_func.h"
#include "trolly.h"
#include "../../engine.h"
#include "../../station.h"
diff --git a/src/ai/trolly/pathfinder.cpp b/src/ai/trolly/pathfinder.cpp
index a18542827..b81ddfebb 100644
--- a/src/ai/trolly/pathfinder.cpp
+++ b/src/ai/trolly/pathfinder.cpp
@@ -6,7 +6,7 @@
#include "../../debug.h"
#include "../../functions.h"
#include "../../map.h"
-#include "../../command.h"
+#include "../../command_func.h"
#include "trolly.h"
#include "../../depot.h"
#include "../../tunnel_map.h"
diff --git a/src/ai/trolly/trolly.cpp b/src/ai/trolly/trolly.cpp
index c95e7d1a5..373e297d2 100644
--- a/src/ai/trolly/trolly.cpp
+++ b/src/ai/trolly/trolly.cpp
@@ -25,7 +25,7 @@
#include "../../station_map.h"
#include "table/strings.h"
#include "../../map.h"
-#include "../../command.h"
+#include "../../command_func.h"
#include "trolly.h"
#include "../../town.h"
#include "../../industry.h"