(svn r206) -Fix: [1001540] i lost all wagons. Half-assed fix for lost wagons. But now users can at least fix this problem. Consolecommand: "resetengines"
authordarkvater
Sat, 11 Sep 2004 19:18:30 +0000
changeset 205 49e96fd94d63
parent 204 1646d7049950
child 206 7f8c26d8526b
(svn r206) -Fix: [1001540] i lost all wagons. Half-assed fix for lost wagons. But now users can at least fix this problem. Consolecommand: "resetengines"
console.c
console.h
console_cmds.h
engine.c
ttd.vcproj
--- a/console.c	Sat Sep 11 14:48:31 2004 +0000
+++ b/console.c	Sat Sep 11 19:18:30 2004 +0000
@@ -1267,6 +1267,7 @@
 }
 
 static void IConsoleStdLibRegister() {
+	// functions
 	IConsoleCmdRegister("debug_level",IConsoleStdLibDebugLevel);
 	IConsoleCmdRegister("dump_vars",IConsoleStdLibListDumpVariables);
 	IConsoleCmdRegister("echo",IConsoleStdLibEcho);
@@ -1281,6 +1282,9 @@
 	IConsoleCmdRegister("list_vars",IConsoleStdLibListVariables);
 	IConsoleCmdRegister("screenshot",IConsoleStdLibScreenShot);
 	IConsoleCmdRegister("varinfo",IConsoleStdLibVarInfo);
+	IConsoleCmdRegister("resetengines",IConsoleResetEngines);
+
+	// variables
 	IConsoleVarRegister("cursor_rate",(void *) &_icursor_rate,ICONSOLE_VAR_BYTE);
 	IConsoleVarRegister("con_developer",(void *) &_stdlib_con_developer,ICONSOLE_VAR_BOOLEAN);
 	IConsoleVarRegister("developer",(void *) &_stdlib_developer,ICONSOLE_VAR_BYTE);
--- a/console.h	Sat Sep 11 14:48:31 2004 +0000
+++ b/console.h	Sat Sep 11 19:18:30 2004 +0000
@@ -1,3 +1,5 @@
+#ifndef CONSOLE_H
+#define CONSOLE_H
 // ** console ** //
 
 enum {
@@ -88,3 +90,7 @@
 // *** Parser *** //
 
 void IConsoleCmdExec(byte * cmdstr);
+
+#include "console_cmds.h"
+
+#endif /* CONSOLE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/console_cmds.h	Sat Sep 11 19:18:30 2004 +0000
@@ -0,0 +1,13 @@
+#ifndef CONSOLE_CMDS_H
+#define CONSOLE_CMDS_H
+
+/* Console_CMDS.h is the placeholder of all the console commands
+ * that will be added to the game. Register the command in
+ * * console.c IConsoleStdLibRegister;
+ * then put the command in the appropiate place (eg. where it belongs, stations
+ * stuff in station_cmd.c, etc.), and add the function decleration here.
+ */
+
+_iconsole_var * IConsoleResetEngines(byte argc, byte* argv[], byte argt[]);
+
+#endif /* CONSOLE_CMDS_H */
--- a/engine.c	Sat Sep 11 14:48:31 2004 +0000
+++ b/engine.c	Sat Sep 11 19:18:30 2004 +0000
@@ -7,6 +7,7 @@
 #include "vehicle.h"
 #include "news.h"
 #include "saveload.h"
+#include "console.h"
 
 #define UPDATE_PLAYER_RAILTYPE(e,p) if ((byte)(e->railtype + 1) > p->max_railtype) p->max_railtype = e->railtype + 1;
 
@@ -164,6 +165,7 @@
 	AdjustAvailAircraft();
 }
 
+_iconsole_var * IConsoleResetEngines(byte argc, byte* argv[], byte argt[]) {StartupEngines(); return 0;}
 
 uint32 _engine_refit_masks[256];
 
--- a/ttd.vcproj	Sat Sep 11 14:48:31 2004 +0000
+++ b/ttd.vcproj	Sat Sep 11 19:18:30 2004 +0000
@@ -1105,6 +1105,9 @@
 				RelativePath="console.h">
 			</File>
 			<File
+				RelativePath=".\console_cmds.h">
+			</File>
+			<File
 				RelativePath="economy.h">
 			</File>
 			<File