- fixed: Dehacked text patching needs to alter all occurences of the source string.

This commit is contained in:
Christoph Oelckers 2015-02-09 10:15:11 +01:00
parent 867bfd2751
commit 6423b2fece

View file

@ -2190,24 +2190,25 @@ static int PatchText (int oldSize)
} }
} }
if (!good) // Search through most other texts
{ const char *str;
// Search through most other texts do
const char *str; {
str = EnglishStrings->MatchString (oldStr); str = EnglishStrings->MatchString(oldStr);
if (str != NULL) if (str != NULL)
{ {
GStrings.SetString (str, newStr); GStrings.SetString(str, newStr);
EnglishStrings->SetString(str, "~~"); // set to something invalid so that it won't get found again by the next iteration or by another replacement later
good = true; good = true;
} }
}
while (str != NULL); // repeat search until the text can no longer be found
if (!good) if (!good)
{ {
DPrintf (" (Unmatched)\n"); DPrintf (" (Unmatched)\n");
}
} }
donewithtext: donewithtext:
if (newStr) if (newStr)
delete[] newStr; delete[] newStr;