diff options
author | Colin Snover | 2016-09-26 10:32:09 -0500 |
---|---|---|
committer | Colin Snover | 2016-09-29 19:39:16 -0500 |
commit | 5877542d7eca653ffaa31f2666bc32ffca241e61 (patch) | |
tree | cb95405e49dddf235f8b09a7d6657ba13e37edef /engines/sci/engine | |
parent | 3f6cfff225f6b23310e25e3ff44423ef2e49ad8c (diff) | |
download | scummvm-rg350-5877542d7eca653ffaa31f2666bc32ffca241e61.tar.gz scummvm-rg350-5877542d7eca653ffaa31f2666bc32ffca241e61.tar.bz2 scummvm-rg350-5877542d7eca653ffaa31f2666bc32ffca241e61.zip |
SCI32: Ease debugging of wrong array types
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/segment.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h index fd9b3f759e..2af47801b2 100644 --- a/engines/sci/engine/segment.h +++ b/engines/sci/engine/segment.h @@ -664,7 +664,9 @@ public: const reg_t *source = values; int16 *target = (int16 *)_data + index; while (count--) { - assert(source->isNumber()); + if (!source->isNumber()) { + error("Non-number %04x:%04x sent to int16 array", PRINT_REG(*source)); + } *target++ = source->toSint16(); ++source; } @@ -683,7 +685,9 @@ public: const reg_t *source = values; byte *target = (byte *)_data + index; while (count--) { - assert(source->isNumber()); + if (!source->isNumber()) { + error("Non-number %04x:%04x sent to byte or string array", PRINT_REG(*source)); + } *target++ = source->getOffset(); ++source; } |