aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-09-26 22:55:24 +0000
committerWillem Jan Palenstijn2009-09-26 22:55:24 +0000
commitbe0b1e060bd5c8bd9ade520e827c9135658de04f (patch)
tree0698a63698de6e642cc0c69e456c357e5d8d4e7d /engines/sci
parenta49da8381b25d3d536e28a906a16093ad23d2993 (diff)
downloadscummvm-rg350-be0b1e060bd5c8bd9ade520e827c9135658de04f.tar.gz
scummvm-rg350-be0b1e060bd5c8bd9ade520e827c9135658de04f.tar.bz2
scummvm-rg350-be0b1e060bd5c8bd9ade520e827c9135658de04f.zip
SCI: Fix regression in r44081 breaking walking in QfG2
svn-id: r44383
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kstring.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index 5cd4aba54d..3d22936680 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -352,7 +352,7 @@ static int is_print_str(const char *str) {
reg_t kStrAt(EngineState *s, int, int argc, reg_t *argv) {
- char *dest = s->segMan->derefString(argv[0]);
+ byte *dest = (byte*)s->segMan->derefString(argv[0]);
reg_t *dest2;
if (!dest) {
@@ -370,7 +370,8 @@ reg_t kStrAt(EngineState *s, int, int argc, reg_t *argv) {
if ((argc == 2) &&
/* Our pathfinder already works around the issue we're trying to fix */
(strcmp(s->segMan->getDescription(argv[0]), AVOIDPATH_DYNMEM_STRING) != 0) &&
- ((strlen(dest) < 2) || (!lsl5PasswordWorkaround && !is_print_str(dest)))) {
+ ((strlen((const char*)dest) < 2) ||
+ (!lsl5PasswordWorkaround && !is_print_str((const char*)dest)))) {
// SQ4 array handling detected
#ifndef SCUMM_BIG_ENDIAN
int odd = argv[1].toUint16() & 1;
@@ -378,7 +379,7 @@ reg_t kStrAt(EngineState *s, int, int argc, reg_t *argv) {
int odd = !(argv[1].toUint16() & 1);
#endif
dest2 = ((reg_t *) dest) + (argv[1].toUint16() / 2);
- dest = ((char *)(&dest2->offset)) + odd;
+ dest = ((byte *)(&dest2->offset)) + odd;
} else
dest += argv[1].toUint16();