aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-10-23 20:22:24 +0000
committerMartin Kiewitz2010-10-23 20:22:24 +0000
commitae6aa8a6b354b5050406ba87626535ffef0be541 (patch)
treea4ee1396eb4d34fe16171968b685f6395ac2e755
parent4e9cae8ca8f26d8d8ce41260015111337b990500 (diff)
downloadscummvm-rg350-ae6aa8a6b354b5050406ba87626535ffef0be541.tar.gz
scummvm-rg350-ae6aa8a6b354b5050406ba87626535ffef0be541.tar.bz2
scummvm-rg350-ae6aa8a6b354b5050406ba87626535ffef0be541.zip
SCI: always allocate +1 byte in kMemory now
fixes multilingual lsl5 room 280 - names of airport ladies not shown correctly (bug #3093818) svn-id: r53746
-rw-r--r--engines/sci/engine/kmisc.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index d8ae1a3418..bbade82fef 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -231,14 +231,18 @@ reg_t kMemory(EngineState *s, int argc, reg_t *argv) {
switch (argv[0].toUint16()) {
case K_MEMORY_ALLOCATE_CRITICAL: {
int byteCount = argv[1].toUint16();
- // WORKAROUND: pq3 (multilingual) when plotting crimes - allocates the
- // returned bytes from kStrLen on "W" and "E" and wants to put a
- // string in there, which doesn't fit of course. That's why we allocate
- // one byte more all the time inside that room
- if (g_sci->getGameId() == GID_PQ3) {
- if (s->currentRoomNumber() == 202)
- byteCount++;
- }
+ // WORKAROUND:
+ // - pq3 (multilingual) room 202
+ // when plotting crimes, allocates the returned bytes from kStrLen
+ // on "W" and "E" and wants to put a string in there, which doesn't
+ // fit of course.
+ // - lsl5 (multilingual) room 280
+ // allocates memory according to a previous kStrLen for the name of
+ // the airport ladies (bug #3093818), which isn't enough
+
+ // We always allocate 1 byte more, because of this
+ byteCount++;
+
if (!s->_segMan->allocDynmem(byteCount, "kMemory() critical", &s->r_acc)) {
error("Critical heap allocation failed");
}