summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-09-11 19:18:30 +0000
committerdarkvater <darkvater@openttd.org>2004-09-11 19:18:30 +0000
commitd03afadad23fced4bbb11df12a01f26cdbaf6844 (patch)
tree9e1cc9f279d8bed981616951fb82a23051f9d21d
parentfe8c317d3ce5b399611ea9d7445b6c0870b041e5 (diff)
downloadopenttd-d03afadad23fced4bbb11df12a01f26cdbaf6844.tar.xz
(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"
-rw-r--r--console.c4
-rw-r--r--console.h6
-rw-r--r--console_cmds.h13
-rw-r--r--engine.c2
-rw-r--r--ttd.vcproj3
5 files changed, 28 insertions, 0 deletions
diff --git a/console.c b/console.c
index 83a36bb36..1c43ae766 100644
--- a/console.c
+++ b/console.c
@@ -1267,6 +1267,7 @@ return NULL;
}
static void IConsoleStdLibRegister() {
+ // functions
IConsoleCmdRegister("debug_level",IConsoleStdLibDebugLevel);
IConsoleCmdRegister("dump_vars",IConsoleStdLibListDumpVariables);
IConsoleCmdRegister("echo",IConsoleStdLibEcho);
@@ -1281,6 +1282,9 @@ static void IConsoleStdLibRegister() {
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);
diff --git a/console.h b/console.h
index 11fc70bdb..f2a7aded1 100644
--- a/console.h
+++ b/console.h
@@ -1,3 +1,5 @@
+#ifndef CONSOLE_H
+#define CONSOLE_H
// ** console ** //
enum {
@@ -88,3 +90,7 @@ void IConsoleVarDump(_iconsole_var * var, byte * dump_desc);
// *** Parser *** //
void IConsoleCmdExec(byte * cmdstr);
+
+#include "console_cmds.h"
+
+#endif /* CONSOLE_H */
diff --git a/console_cmds.h b/console_cmds.h
new file mode 100644
index 000000000..28346ac81
--- /dev/null
+++ b/console_cmds.h
@@ -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 */
diff --git a/engine.c b/engine.c
index 67c8b9239..d7b6d30e0 100644
--- a/engine.c
+++ b/engine.c
@@ -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 @@ void StartupEngines()
AdjustAvailAircraft();
}
+_iconsole_var * IConsoleResetEngines(byte argc, byte* argv[], byte argt[]) {StartupEngines(); return 0;}
uint32 _engine_refit_masks[256];
diff --git a/ttd.vcproj b/ttd.vcproj
index b3b0a0a09..74dad20a4 100644
--- a/ttd.vcproj
+++ b/ttd.vcproj
@@ -1105,6 +1105,9 @@
RelativePath="console.h">
</File>
<File
+ RelativePath=".\console_cmds.h">
+ </File>
+ <File
RelativePath="economy.h">
</File>
<File