summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-12-31 11:12:49 +0000
committerDarkvater <darkvater@openttd.org>2006-12-31 11:12:49 +0000
commitba25cf7defe6e9213da8f86cb4cd3f941fc53bdd (patch)
tree197e3184d3e8078b111cddf56b56b118b8bda186
parent1814212dc7b6c5ba436ae5c10e87ae9a2bf831b6 (diff)
downloadopenttd-ba25cf7defe6e9213da8f86cb4cd3f941fc53bdd.tar.xz
(svn r7692) -Fix: OpenTTD didn't compile without network enabled (newgrf sync code)
-rw-r--r--newgrf_config.c4
-rw-r--r--newgrf_config.h2
-rw-r--r--players.c5
3 files changed, 10 insertions, 1 deletions
diff --git a/newgrf_config.c b/newgrf_config.c
index 9cea7c49d..aa15ffb77 100644
--- a/newgrf_config.c
+++ b/newgrf_config.c
@@ -328,6 +328,8 @@ const GRFConfig *FindGRFConfig(uint32 grfid, uint8 *md5sum)
return NULL;
}
+#ifdef ENABLE_NETWORK
+
/** Structure for UnknownGRFs; this is a lightweight variant of GRFConfig */
typedef struct UnknownGRF UnknownGRF;
struct UnknownGRF {
@@ -377,6 +379,8 @@ char *FindUnknownGRFName(uint32 grfid, uint8 *md5sum, bool create)
return grf->name;
}
+#endif /* ENABLE_NETWORK */
+
/* Retrieve a NewGRF from the current config by its grfid */
GRFConfig *GetGRFConfig(uint32 grfid)
diff --git a/newgrf_config.h b/newgrf_config.h
index 37f5c6d86..6ebc3ffa2 100644
--- a/newgrf_config.h
+++ b/newgrf_config.h
@@ -55,8 +55,10 @@ char *GRFBuildParamList(char *dst, const GRFConfig *c, const char *last);
/* In newgrf_gui.c */
void ShowNewGRFSettings(bool editable, bool show_params, bool exec_changes, GRFConfig **config);
+#ifdef ENABLE_NETWORK
/* For communication about GRFs over the network */
#define UNKNOWN_GRF_NAME_PLACEHOLDER "<Unknown>"
char *FindUnknownGRFName(uint32 grfid, uint8 *md5sum, bool create);
+#endif /* ENABLE_NETWORK */
#endif /* NEWGRF_CONFIG_H */
diff --git a/players.c b/players.c
index c6652b7a3..38b5fa518 100644
--- a/players.c
+++ b/players.c
@@ -844,7 +844,10 @@ int32 CmdPlayerCtrl(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (!_networking) return CMD_ERROR;
/* Has the network client a correct ClientID? */
- if (!(flags & DC_EXEC) || cid >= MAX_CLIENT_INFO) return 0;
+ if (!(flags & DC_EXEC)) return 0;
+#ifdef ENABLE_NETWORK
+ if (cid >= MAX_CLIENT_INFO) return 0;
+#endif /* ENABLE_NETWORK */
/* Delete multiplayer progress bar */
DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);