Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

yet more robustness when faced with broken dialog scripts

Also handle the mergestrings case properly when an argument is not
terminated with quotes. Fixes udvith.dlg in BG2.
  • Loading branch information...
commit c6dd6c51a208c4c028f6200858c5d6b8b4c2fde8 1 parent cad7110
@fizzet fizzet authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 gemrb/core/GameScript/GSUtils.cpp
View
9 gemrb/core/GameScript/GSUtils.cpp
@@ -1640,7 +1640,7 @@ Action* GenerateActionCore(const char *src, const char *str, unsigned short acti
i=0;
}
//breaking on ',' in case of a monkey attack
- //fixes bg1:melicamp.dlg, bg1:sharte.dlg
+ //fixes bg1:melicamp.dlg, bg1:sharte.dlg, bg2:udvith.dlg
//if strings ever need a , inside, this is a FIXME
while (*src != '"' && *src !=',') {
if (*src == 0) {
@@ -1654,6 +1654,9 @@ Action* GenerateActionCore(const char *src, const char *str, unsigned short acti
}
src++;
}
+ if (*src == '"') {
+ src++;
+ }
*dst = 0;
//reading the context part
if (mergestrings) {
@@ -1672,7 +1675,7 @@ Action* GenerateActionCore(const char *src, const char *str, unsigned short acti
}
//this works only if there are no spaces
- if (*src++!='"' || *src++!=',' || *src++!='"') {
+ if (*src++!=',' || *src++!='"') {
break;
}
//reading the context string
@@ -1687,8 +1690,8 @@ Action* GenerateActionCore(const char *src, const char *str, unsigned short acti
}
src++;
}
+ src++; //skipping "
}
- src++; //skipping "
stringsCount++;
}
break;
Please sign in to comment.
Something went wrong with that request. Please try again.