aboutsummaryrefslogtreecommitdiff
path: root/engines/groovie/script.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/groovie/script.cpp')
-rw-r--r--engines/groovie/script.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index eaeb64a64d..3ba3d5d78a 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -26,7 +26,6 @@
#include "groovie/cell.h"
#include "groovie/cursor.h"
#include "groovie/graphics.h"
-#include "groovie/groovie.h"
#include "groovie/music.h"
#include "groovie/player.h"
#include "groovie/resource.h"
@@ -172,7 +171,7 @@ bool Script::loadScript(Common::String filename) {
void Script::directGameLoad(int slot) {
// Reject invalid slots
- if (slot < 0 || slot > 9) {
+ if (slot < 0 || slot > MAX_SAVES - 1) {
return;
}
@@ -397,6 +396,17 @@ void Script::loadgame(uint slot) {
_vm->_grvCursorMan->show(false);
}
+void Script::directGameSave(int slot, const Common::String &desc) {
+ if (slot < 0 || slot > MAX_SAVES - 1) {
+ return;
+ }
+ const char *saveName = desc.c_str();
+ for (int i = 0; i < 15; i++) {
+ _variables[i] = saveName[i] - 0x30;
+ }
+ savegame(slot);
+}
+
void Script::savegame(uint slot) {
char save[15];
char newchar;
@@ -1368,7 +1378,7 @@ void Script::o_checkvalidsaves() {
debugC(1, kDebugScript, "CHECKVALIDSAVES");
// Reset the array of valid saves and the savegame names cache
- for (int i = 0; i < 10; i++) {
+ for (int i = 0; i < MAX_SAVES; i++) {
setVariable(i, 0);
_saveNames[i] = "E M P T Y";
}