@@ -140,12 +140,10 @@ void ApplyItemsInternal(ItemTranslation translation, TranslationEmitter emitter)
140140 }
141141 else if ( ins . OpCode . Equals ( OpCodes . Call ) && ins . Operand is MemberRef n && n . Name . Equals ( "Concat" ) ) // for thorium mod
142142 {
143- int index2 = index , reversedListIndex = 0 , argumentCount = 0 ;
143+ int index2 = index , argumentCount = 0 ;
144144 var total = n . MethodSig . Params . Count + 1 ;
145145
146- var reversedList = translation . ModifyTooltips . GetRange ( index , translation . ModifyTooltips . Count - index ) ;
147- reversedList . Reverse ( ) ;
148-
146+ // get ldstr instructions we need to change their operand
149147 var ldstrList = new List < Instruction > ( ) ;
150148 while ( -- index2 > 0 && argumentCount < total )
151149 {
@@ -160,10 +158,11 @@ void ApplyItemsInternal(ItemTranslation translation, TranslationEmitter emitter)
160158 ldstrList . Add ( ins ) ;
161159 }
162160 }
161+ ldstrList . Reverse ( ) ;
163162
164163 foreach ( var ldstrInstruction in ldstrList )
165164 {
166- ldstrInstruction . Operand = reversedList [ reversedListIndex ++ ] ;
165+ ldstrInstruction . Operand = translation . ModifyTooltips [ listIndex ++ ] ;
167166 index ++ ;
168167 }
169168 }
@@ -409,8 +408,8 @@ void ApplyCustomTranslationsInternal(IList<CustomTranslation> translations, Tran
409408 var ins = inst [ index ] ;
410409
411410 if ( ! ins . OpCode . Equals ( OpCodes . Call ) ||
412- ! ( ins . Operand is IMethod m ) ||
413- ! string . Equals ( m . Name . ToString ( ) , "CreateTranslation" ) )
411+ ! ( ins . Operand is IMethod m ) ||
412+ ! string . Equals ( m . Name . ToString ( ) , "CreateTranslation" ) )
414413 continue ;
415414
416415 if ( ! ( ins = inst [ ++ index ] ) . IsStloc ( ) )
0 commit comments