• R/O
  • SSH

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

This is a fork of Zandronum used on servers hosted by The Sentinels Playground (TSPG), Euroboros (EB), and Down Under Doomers (DUD).


Commit MetaInfo

Révision054a305d9f6b7772f60c9ba0a1507effd91af0e2 (tree)
l'heure2023-07-12 01:37:31
AuteurAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Message de Log

Fixed: strings with "\c[X]x]" at the end were still being treated as a trailing color code.

Change Summary

Modification

diff -r 89bccf7127ba -r 054a305d9f6b src/v_text.cpp
--- a/src/v_text.cpp Sun Jul 09 15:14:38 2023 -0400
+++ b/src/v_text.cpp Tue Jul 11 12:37:31 2023 -0400
@@ -709,19 +709,24 @@
709709 // [BB] Remove trailing color code of type "\c[X]".
710710 else if ( pszString[ulStringLength-1] == ']' )
711711 {
712- // [AK] "\c[X]]" is not a trailing color code.
713- if ( ( ulStringLength > 2 ) && ( pszString[ulStringLength-2] == ']' ) )
714- break;
712+ bool bHitClosingBracket = false;
713+ int i = 0;
715714
716- int i = 0;
717715 for ( i = ulStringLength-2; i >= 2; --i )
718716 {
717+ // [AK] If we hit another ']' (e.g. "\c[X]]"), then it's not a trailing color code.
718+ if ( pszString[i] == ']' )
719+ {
720+ bHitClosingBracket = true;
721+ break;
722+ }
723+
719724 // [AK] We should keep checking for "\c[" until we reach the beginning of the string,
720725 // in case the string contains something like "\c[X[[[]".
721726 if ( ( pszString[i] == '[' ) && V_ColorCodeStart ( pszString, i-2 ) )
722727 break;
723728 }
724- if ( i >= 2 )
729+ if ( ( bHitClosingBracket == false ) && ( i >= 2 ) )
725730 {
726731 pszString[i-2] = 0;
727732 ulStringLength = static_cast<ULONG>(strlen( pszString ));