Opened 17 years ago

Closed 17 years ago

#330 closed defect (duplicate)

Declaration Bug in Script_v1.cpp

Reported by: (none) Owned by: SF/ender
Priority: normal Component: Engine: SCUMM
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: #576369. Ticket imported from: bugs/330.

Attachments (1)

script_v1.cpp.diff (597 bytes ) - added by (none) 17 years ago.
The patch!

Download all attachments as: .zip

Change History (3)

by (none), 17 years ago

Attachment: script_v1.cpp.diff added

The patch!

comment:1 by SF/ender, 17 years ago

Owner: set to SF/ender
Resolution: duplicate
Status: newclosed

comment:2 by SF/ender, 17 years ago

Closing - duplicate

Note: See TracTickets for help on using tickets.