[Scummvm-cvs-logs] CVS: scummvm script_v2.cpp,1.41,1.42
James Brown
ender at users.sourceforge.net
Mon Apr 8 23:47:07 CEST 2002
Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv14033
Modified Files:
script_v2.cpp
Log Message:
Fix the BUN string parser. Doesn't crash other games anymore :)
Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script_v2.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** script_v2.cpp 8 Apr 2002 13:55:03 -0000 1.41
--- script_v2.cpp 9 Apr 2002 06:46:24 -0000 1.42
***************
*** 2355,2371 ****
void Scumm::o6_talkActor() {
- char *pointer = NULL, *string = NULL;
_actorToPrintStrFor = pop();
! pointer = string = (char *)_scriptPointer;
!
! pointer = strtok(pointer, "/");
! if (pointer) {
! playBundleSound(pointer);
! pointer = strtok(NULL, "");
! _messagePtr = (unsigned char *)pointer;
! } else {
! _messagePtr = (unsigned char *)string;
! }
setStringVars(0);
actorTalk();
--- 2355,2369 ----
void Scumm::o6_talkActor() {
_actorToPrintStrFor = pop();
! _messagePtr = _scriptPointer;
+ if (_scriptPointer[0] == '/') {
+ char *pointer = strtok((char *)_scriptPointer, "/");
+ int bunsize = strlen(pointer) + 2;
+ playBundleSound(pointer);
+ _scriptPointer += bunsize;
+ _messagePtr = _scriptPointer;
+ }
+
setStringVars(0);
actorTalk();
***************
*** 2376,2379 ****
--- 2374,2386 ----
_actorToPrintStrFor = (unsigned char)_vars[VAR_EGO];
_messagePtr = _scriptPointer;
+
+ if (_scriptPointer[0] == '/') {
+ char *pointer = strtok((char *)_scriptPointer, "/");
+ int bunsize = strlen(pointer) + 2;
+ playBundleSound(pointer);
+ _scriptPointer += bunsize;
+ _messagePtr = _scriptPointer;
+ }
+
setStringVars(0);
actorTalk();
***************
*** 2827,2842 ****
string[m].no_talk_anim = true;
break;
! case 75:
! _messagePtr = _scriptPointer;
switch(m) {
! case 0: actorTalk(); break;
! case 1: drawString(1); break;
!
! case 2: unkMessage1(); break;
! case 3: unkMessage2(); break;
}
_scriptPointer = _messagePtr;
return;
!
case 0xFE:
setStringVars(m);
--- 2834,2857 ----
string[m].no_talk_anim = true;
break;
! case 75: {
! _messagePtr = _scriptPointer;
!
! if (_scriptPointer[0] == '/') {
! char *pointer = strtok((char *)_scriptPointer, "/");
! int bunsize = strlen(pointer) + 2;
! playBundleSound(pointer);
! _scriptPointer += bunsize;
! _messagePtr = _scriptPointer;
! }
!
switch(m) {
! case 0: actorTalk(); break;
! case 1: drawString(1); break;
! case 2: unkMessage1(); break;
! case 3: unkMessage2(); break;
}
_scriptPointer = _messagePtr;
return;
! }
case 0xFE:
setStringVars(m);
More information about the Scummvm-git-logs
mailing list