# HG changeset patch # User Darkvater # Date 1167563569 0 # Node ID b83442e14fd4ff759669c8942bbb3841f14a518c # Parent 9306678a0078e6384a9b18529ec22b60ca8b3233 (svn r7692) -Fix: OpenTTD didn't compile without network enabled (newgrf sync code) diff -r 9306678a0078 -r b83442e14fd4 newgrf_config.c --- a/newgrf_config.c Sun Dec 31 10:30:37 2006 +0000 +++ b/newgrf_config.c Sun Dec 31 11:12:49 2006 +0000 @@ -328,6 +328,8 @@ 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 @@ return grf->name; } +#endif /* ENABLE_NETWORK */ + /* Retrieve a NewGRF from the current config by its grfid */ GRFConfig *GetGRFConfig(uint32 grfid) diff -r 9306678a0078 -r b83442e14fd4 newgrf_config.h --- a/newgrf_config.h Sun Dec 31 10:30:37 2006 +0000 +++ b/newgrf_config.h Sun Dec 31 11:12:49 2006 +0000 @@ -55,8 +55,10 @@ /* 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 "" char *FindUnknownGRFName(uint32 grfid, uint8 *md5sum, bool create); +#endif /* ENABLE_NETWORK */ #endif /* NEWGRF_CONFIG_H */ diff -r 9306678a0078 -r b83442e14fd4 players.c --- a/players.c Sun Dec 31 10:30:37 2006 +0000 +++ b/players.c Sun Dec 31 11:12:49 2006 +0000 @@ -844,7 +844,10 @@ 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);