- 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,23 +2190,24 @@ static int PatchText (int oldSize)
} }
} }
if (!good) // Search through most other texts
const char *str;
do
{ {
// Search through most other texts str = EnglishStrings->MatchString(oldStr);
const char *str;
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;
} }
if (!good)
{
DPrintf (" (Unmatched)\n");
}
} }
while (str != NULL); // repeat search until the text can no longer be found
if (!good)
{
DPrintf (" (Unmatched)\n");
}
donewithtext: donewithtext:
if (newStr) if (newStr)