From 584f76ada6135b145d75247c0092001aac356252 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 28 Dec 2003 15:50:10 +0000 Subject: This could be wrong so feel free to revert, but it does seem to fix crashes in the Mine Road sequence of Full Throttle for me. The crashes were always in proc64(), with 'en' being some ridiculously large value. The function, as it was written, did not make any sense to me so I rewrote it with the assumption that it's there to remove the "en"th element of the _val216d[] (remaining enemies?) array. I don't know how well it will work from proc63() if there's more than one element to remove - at least if the elements to remove are neighbours - but maybe that case never happens. svn-id: r11999 --- scumm/smush/insane.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scumm/smush/insane.cpp b/scumm/smush/insane.cpp index f2f78a7afa..060520c57d 100644 --- a/scumm/smush/insane.cpp +++ b/scumm/smush/insane.cpp @@ -7780,12 +7780,10 @@ void Insane::proc63(void) { } void Insane::proc64(int32 enemy1) { - int en = _val215d; + _val215d--; - for (en = _val215d; enemy1 < en; en++) + for (int en = enemy1; en < _val215d; en++) _val216d[en] = _val216d[en + 1]; - - _val215d = en - 1; } void Insane::iactScene3(byte *renderBitmap, int32 codecparam, int32 setupsan12, -- cgit v1.2.3