summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-10-12 14:42:00 +0000
committerDarkvater <darkvater@openttd.org>2006-10-12 14:42:00 +0000
commit110fc94cb539fcb742e8c01ee52e130d4ca9989e (patch)
treed6137e3f74b95c0ab9bddfa6a5f7cce396e73a76
parentfa438870033b1b49936491b95e7479e2ac1b15cb (diff)
downloadopenttd-110fc94cb539fcb742e8c01ee52e130d4ca9989e.tar.xz
(svn r6752) -Codechange: Move command functions from messy functions.h into command.h
-rw-r--r--ai/ai.h1
-rw-r--r--callback_table.h2
-rw-r--r--command.h7
-rw-r--r--functions.h5
4 files changed, 9 insertions, 6 deletions
diff --git a/ai/ai.h b/ai/ai.h
index ec06b302f..440d3347a 100644
--- a/ai/ai.h
+++ b/ai/ai.h
@@ -4,6 +4,7 @@
#include "../functions.h"
#include "../network.h"
#include "../player.h"
+#include "../command.h"
/* How DoCommands look like for an AI */
typedef struct AICommand {
diff --git a/callback_table.h b/callback_table.h
index 15c8d4d6a..f555fcf60 100644
--- a/callback_table.h
+++ b/callback_table.h
@@ -3,7 +3,7 @@
#ifndef CALLBACK_TABLE_H
#define CALLBACK_TABLE_H
-#include "functions.h"
+#include "command.h"
extern CommandCallback *_callback_table[];
extern const int _callback_table_count;
diff --git a/command.h b/command.h
index 497f018cf..d46c771dd 100644
--- a/command.h
+++ b/command.h
@@ -195,7 +195,14 @@ static inline bool CmdFailed(int32 res)
}
/* command.c */
+typedef void CommandCallback(bool success, TileIndex tile, uint32 p1, uint32 p2);
int32 DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
+bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd);
+
+#ifdef ENABLE_NETWORK
+
+void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback);
+#endif /* ENABLE_NETWORK */
extern const char* _cmd_text; // Text, which gets sent with a command
diff --git a/functions.h b/functions.h
index f79e20cd8..cd59d8fb2 100644
--- a/functions.h
+++ b/functions.h
@@ -132,9 +132,6 @@ bool CheckBridge_Stuff(byte bridge_type, uint bridge_len);
uint32 GetBridgeLength(TileIndex begin, TileIndex end);
int CalcBridgeLenCostFactor(int x);
-typedef void CommandCallback(bool success, TileIndex tile, uint32 p1, uint32 p2);
-bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd);
-
/* network.c */
void NetworkUDPClose(void);
void NetworkStartUp(void);
@@ -145,8 +142,6 @@ bool NetworkServerStart(void);
bool NetworkClientConnectGame(const char* host, unsigned short port);
void NetworkReboot(void);
void NetworkDisconnect(void);
-void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback);
-
/* misc_cmd.c */
void PlaceTreesRandomly(void);