summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-01-31 00:12:44 +0000
committerdarkvater <darkvater@openttd.org>2005-01-31 00:12:44 +0000
commit493ae95ce59ec96a02c8287b103b117791097c77 (patch)
treee9d1f7d49296e046e372efc752a31708d23a4bb4
parent26ef673f66757cb2d033e45f329136d3069637a8 (diff)
downloadopenttd-493ae95ce59ec96a02c8287b103b117791097c77.tar.xz
(svn r1747) - Fix: [network] ottd should compile when networking is disabled.
- Change: change strgen project file to get rid of warning.
-rw-r--r--console.c18
-rw-r--r--strgen/strgen.vcproj3
-rw-r--r--ttd.c2
3 files changed, 13 insertions, 10 deletions
diff --git a/console.c b/console.c
index e97d5cf6c..98019c9b6 100644
--- a/console.c
+++ b/console.c
@@ -232,7 +232,6 @@ extern const char _openttd_revision[];
void IConsoleInit(void)
{
- uint i;
_iconsole_output_file = NULL;
_iconsole_color_default = 1;
_iconsole_color_error = 3;
@@ -247,12 +246,15 @@ void IConsoleInit(void)
_icursor_state = false;
_icursor_rate = 5;
_icursor_counter = 0;
- for (i = 0; i < lengthof(_iconsole_cmdbuffer); i++)
- _iconsole_cmdbuffer[i] = NULL;
- for (i = 0; i <= ICON_BUFFER; i++) {
- _iconsole_buffer[i] = NULL;
- _iconsole_cbuffer[i] = 0;
- }
+
+#ifdef ENABLE_NETWORK /* Initialize network only variables */
+ _redirect_console_to_client = 0;
+#endif
+
+ memset(_iconsole_cmdbuffer, 0, sizeof(_iconsole_cmdbuffer));
+ memset(_iconsole_buffer, 0, sizeof(_iconsole_buffer));
+ memset(_iconsole_cbuffer, 0, sizeof(_iconsole_cbuffer));
+
IConsoleStdLibRegister();
IConsolePrintF(13, "OpenTTD Game Console Revision 6 - %s", _openttd_revision);
IConsolePrint(12, "---------------------------------");
@@ -393,11 +395,13 @@ void IConsolePrint(uint16 color_code, const char* string)
char* i;
int j;
+#ifdef ENABLE_NETWORK
if (_redirect_console_to_client != 0) {
/* Redirect the string to the client */
SEND_COMMAND(PACKET_SERVER_RCON)(NetworkFindClientStateFromIndex(_redirect_console_to_client), color_code, string);
return;
}
+#endif
if (_network_dedicated) {
printf("%s\n", string);
diff --git a/strgen/strgen.vcproj b/strgen/strgen.vcproj
index 509d8cadd..f5f25125e 100644
--- a/strgen/strgen.vcproj
+++ b/strgen/strgen.vcproj
@@ -87,8 +87,9 @@
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
+ WarnAsError="TRUE"
SuppressStartupBanner="TRUE"
- DebugInformationFormat="4"/>
+ DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
diff --git a/ttd.c b/ttd.c
index f4106fafd..0fe6af5a7 100644
--- a/ttd.c
+++ b/ttd.c
@@ -583,8 +583,6 @@ int ttd_main(int argc, char* argv[])
_dedicated_forks = false;
_dedicated_enabled = false;
- _redirect_console_to_client = 0;
-
// The last param of the following function means this:
// a letter means: it accepts that param (e.g.: -h)
// a ':' behind it means: it need a param (e.g.: -m<driver>)