From 5877542d7eca653ffaa31f2666bc32ffca241e61 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Mon, 26 Sep 2016 10:32:09 -0500 Subject: SCI32: Ease debugging of wrong array types --- engines/sci/engine/segment.h | 8 ++++++-- 1 file 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; } -- cgit v1.2.3