#7974 closed patch (wontfix)
Declaration Bug in Script_v1.cpp
Reported by: | (none) | Owned by: | fingolfin |
---|---|---|---|
Priority: | normal | Component: | Engine: SCUMM |
Version: | Keywords: | ||
Cc: | Game: | Monkey Island 1 |
Description
I just played Monkey Island 1 when, but unfortunately it crashed when Guybrush trys to get the idol from gov. Marleys home.
I get the following error message:
WARNING: New name of object 930 too long (old *gefhrliches Lama@@@@@@@@@@@@@@@@@@@@* new *wahnsinnig gefhrliches Lama*)
The reason I found was in script_v1.cpp line 2173:
size = getResourceDataSize(name);
size is declared as int, where getResourceDataSize(name) returns unsigned int.
The following patch should solve the problem:
--- script_v1.cpp.orig Sun Jun 30 15:21:37 2002 +++ script_v1.cpp Tue Jul 2 15:10:45 2002 @@ -2157,9 +2157,9 @@ void Scumm::o5_setObjectName() { int obj = getVarOrDirectWord(0x80); - int size; + unsigned int size; int a; - int i; + unsigned int i; byte *name; unsigned char work[255];
@@ -2186,8 +2186,8 @@
if (i >= size) { work[i] = 0; - warning("New name of object %d too long (old *%s* new *%s*)", - obj, name, work); + warning("New name of object %d too long (old *%s* new *%s*); (oldsize %i, newsize %i)\n", + obj, name, work, size, i); i = size - 1; }
Ticket imported from: #576412. Ticket imported from: patches/79.
Attachments (1)
Change History (8)
by , 22 years ago
Attachment: | script_v1.cpp.diff added |
---|
comment:1 by , 22 years ago
Component: | Engine: SCUMM |
---|---|
Game: | Monkey Island 1 |
comment:2 by , 22 years ago
I am transfering this to the Patch Tracker. Please don't enter patches into the bug tracker :) You should also register a SourceForge account.
Anyway, this still does not make any sense to me. What are the exact new and old size values you are getting in this instance?
I cannot see any reason why the unsigned/signed typecast would matter, unless something else is seriously wrong...
comment:3 by , 22 years ago
Owner: | set to |
---|
comment:4 by , 22 years ago
This patch is indeed not correct, but rather is an incorrect workaround for a real ugly problem. However, I have a clear idea as to what is causing the problem, and how to fix the issue.
comment:5 by , 22 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:7 by , 6 years ago
Component: | → Engine: SCUMM |
---|---|
Game: | → Monkey Island 1 |
Summary: | Declaration Bug in Script_v1.cpp → Declaration Bug in Script_v1.cpp |
The patch!