]> Chaos Git - vn/vndc.git/commitdiff
Made op_save, a way to call DumpSave in-game. More checks will be necessary since...
authorchaoskagami <chaos.kagami@gmail.com>
Tue, 23 Sep 2014 03:40:18 +0000 (23:40 -0400)
committerchaoskagami <chaos.kagami@gmail.com>
Tue, 23 Sep 2014 03:40:18 +0000 (23:40 -0400)
vndc/include/Funcs.hpp
vndc/include/gitrev.hpp
vndc/src/Parse.cpp
vndc/src/op_save.cpp [new file with mode: 0644]

index 4153a6fab91f6254ddbd0ddf9bd3445385a426db..3ae17bafee85eb38c1184472cc2a6882cd901a64 100644 (file)
@@ -37,4 +37,7 @@ void op_jump(char* file, int* lineTo, bool isSave);
 void op_goto(char* label);
 void op_choice(char* choices);
 
+// Extensions.
+void op_save(char* file);
+
 #endif
index fde0a33dd4bccb0d84a7376d9904d15d668cbcaf..d15b922545d181c8e02bdfdc12e660f1992399c8 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef GIT_REV_HDR
 #define GIT_REV_HDR
-#define GIT_REV "5ffbbb9138bc91e95291e2f89f3fbf30e8b33d91"
+#define GIT_REV "600f8372132a379e10f46584bba06b5013e8bf05"
 
 #endif
index 880c9780edfe6ff4fb98e3ccf137968333c1ec24..2effdac30741001f1986c868510e12f43685b76d 100644 (file)
@@ -142,6 +142,8 @@ void ParseCmd(char* line) {
                op_goto(tokens[1]);
        else if(!strcmp(tokens[0], "cleartext"))
                op_cleartext();
+       else if(!strcmp(tokens[0], "save") && num == 2)
+               op_save(tokens[1]);
 
        free(tokens);
        free(passthru_line);
@@ -193,7 +195,7 @@ void ParseShell() {
                        DebugContinue = false;
                        GetData()->wait_input = true;
                }
-               else if (!strncmp(buffer, "save", 4)) {
+               else if (!strncmp(buffer, "debugsave", 4)) {
                        char* savefile = &buffer[5];
                        printf("[debug] Saving to file '%s' NOW.\n", savefile);
                        DumpSave(savefile);
diff --git a/vndc/src/op_save.cpp b/vndc/src/op_save.cpp
new file mode 100644 (file)
index 0000000..cda54e9
--- /dev/null
@@ -0,0 +1,12 @@
+/* op_save - saves the game to a save.
+   Params; name.
+ */
+
+#include "Zero.hpp"
+#include "Funcs.hpp"
+
+void op_save(char* name) {
+       DumpSave(name); // Just a wrapper. No harm done.
+                       // TODO - Replace all dumpsave calls with this and move function here
+}
+