1
0
Fork 0

(svn r1747) - Fix: [network] ottd should compile when networking is disabled.

- Change: change strgen project file to get rid of warning.
release/0.4.5
darkvater 2005-01-31 00:12:44 +00:00
parent f4ffba1a6e
commit 4cc0952736
3 changed files with 13 additions and 10 deletions

View File

@ -232,7 +232,6 @@ extern const char _openttd_revision[];
void IConsoleInit(void) void IConsoleInit(void)
{ {
uint i;
_iconsole_output_file = NULL; _iconsole_output_file = NULL;
_iconsole_color_default = 1; _iconsole_color_default = 1;
_iconsole_color_error = 3; _iconsole_color_error = 3;
@ -247,12 +246,15 @@ void IConsoleInit(void)
_icursor_state = false; _icursor_state = false;
_icursor_rate = 5; _icursor_rate = 5;
_icursor_counter = 0; _icursor_counter = 0;
for (i = 0; i < lengthof(_iconsole_cmdbuffer); i++)
_iconsole_cmdbuffer[i] = NULL; #ifdef ENABLE_NETWORK /* Initialize network only variables */
for (i = 0; i <= ICON_BUFFER; i++) { _redirect_console_to_client = 0;
_iconsole_buffer[i] = NULL; #endif
_iconsole_cbuffer[i] = 0;
} memset(_iconsole_cmdbuffer, 0, sizeof(_iconsole_cmdbuffer));
memset(_iconsole_buffer, 0, sizeof(_iconsole_buffer));
memset(_iconsole_cbuffer, 0, sizeof(_iconsole_cbuffer));
IConsoleStdLibRegister(); IConsoleStdLibRegister();
IConsolePrintF(13, "OpenTTD Game Console Revision 6 - %s", _openttd_revision); IConsolePrintF(13, "OpenTTD Game Console Revision 6 - %s", _openttd_revision);
IConsolePrint(12, "---------------------------------"); IConsolePrint(12, "---------------------------------");
@ -393,11 +395,13 @@ void IConsolePrint(uint16 color_code, const char* string)
char* i; char* i;
int j; int j;
#ifdef ENABLE_NETWORK
if (_redirect_console_to_client != 0) { if (_redirect_console_to_client != 0) {
/* Redirect the string to the client */ /* Redirect the string to the client */
SEND_COMMAND(PACKET_SERVER_RCON)(NetworkFindClientStateFromIndex(_redirect_console_to_client), color_code, string); SEND_COMMAND(PACKET_SERVER_RCON)(NetworkFindClientStateFromIndex(_redirect_console_to_client), color_code, string);
return; return;
} }
#endif
if (_network_dedicated) { if (_network_dedicated) {
printf("%s\n", string); printf("%s\n", string);

View File

@ -87,8 +87,9 @@
ObjectFile=".\Debug/" ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/" ProgramDataBaseFileName=".\Debug/"
WarningLevel="3" WarningLevel="3"
WarnAsError="TRUE"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
DebugInformationFormat="4"/> DebugInformationFormat="3"/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool

2
ttd.c
View File

@ -583,8 +583,6 @@ int ttd_main(int argc, char* argv[])
_dedicated_forks = false; _dedicated_forks = false;
_dedicated_enabled = false; _dedicated_enabled = false;
_redirect_console_to_client = 0;
// The last param of the following function means this: // The last param of the following function means this:
// a letter means: it accepts that param (e.g.: -h) // a letter means: it accepts that param (e.g.: -h)
// a ':' behind it means: it need a param (e.g.: -m<driver>) // a ':' behind it means: it need a param (e.g.: -m<driver>)