File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -239,7 +239,7 @@ private static bool Connection_OnReceivedServerMessagePacket(Packet packet)
239239 var p = ( OXGaming . TibiaAPI . Network . ServerPackets . Message ) packet ;
240240 if ( p . MessageMode == MessageModeType . Look )
241241 {
242- if ( _lookPlayerRx . IsMatch ( p . Text ) || p . Text . Contains ( "You see yourself." ) )
242+ if ( _lookPlayerRx . IsMatch ( p . Text ) || p . Text . Contains ( "You see yourself." , StringComparison . OrdinalIgnoreCase ) )
243243 {
244244 p . Text = "Redacted" ;
245245 }
@@ -256,6 +256,12 @@ private static bool Connection_OnReceivedServerTalkPacket(Packet packet)
256256 p . SpeakerLevel = 100 ;
257257 p . SpeakerName = "Redacted" ;
258258 }
259+ else if ( creature is object && creature . Type == CreatureType . Npc )
260+ {
261+ // In case the NPC used the player's name in their message,
262+ // we need to check and replace it.
263+ p . Text = p . Text . Replace ( p . Client . Player . Name , "Redacted" , StringComparison . OrdinalIgnoreCase ) ;
264+ }
259265 return true ;
260266 }
261267
You can’t perform that action at this time.
0 commit comments