This is a fork of Zandronum Beta for Mac Os (Silicon and Intel)
修訂 | 0b2078a75ace719f4c7ac7c6d79750fd961bf5d0 (tree) |
---|---|
時間 | 2022-08-22 23:15:55 |
作者 | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Fixed: V_RemoveTrailingCrap couldn't remove a trailing color code that was formatted like "\c[X[[[]".
@@ -774,10 +774,12 @@ | ||
774 | 774 | int i = 0; |
775 | 775 | for ( i = ulStringLength-2; i >= 2; --i ) |
776 | 776 | { |
777 | - if ( pszString[i] == '[' ) | |
777 | + // [AK] We should keep checking for "\c[" until we reach the beginning of the string, | |
778 | + // in case the string contains something like "\c[X[[[]". | |
779 | + if ( ( pszString[i] == '[' ) && V_ColorCodeStart ( pszString, i-2 ) ) | |
778 | 780 | break; |
779 | 781 | } |
780 | - if ( ( i >= 2 ) && V_ColorCodeStart ( pszString, i-2 ) ) | |
782 | + if ( i >= 2 ) | |
781 | 783 | { |
782 | 784 | pszString[i-2] = 0; |
783 | 785 | ulStringLength = static_cast<ULONG>(strlen( pszString )); |