Skip to content

Commit

Permalink
Support multiple spaces in custom damage source ID display names (#835)
Browse files Browse the repository at this point in the history
Replace all spaces
  • Loading branch information
Dinorush authored Aug 14, 2024
1 parent 75bbc18 commit 7aa3958
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Northstar.Custom/mod/scripts/vscripts/sh_damage_types.nut
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ bool function RegisterWeaponDamageSourceInternal( int id, string newVal, string
damageSourceID[ newVal ] <- id
file.damageSourceIDToString[ id ] <- newVal
file.damageSourceIDToName[ id ] <- stringVal
file.customDamageSourceIDList.extend( [ id.tostring(), newVal, StringReplace( stringVal, " ", MESSAGE_SPACE_PADDING ) ] )
file.customDamageSourceIDList.extend( [ id.tostring(), newVal, StringReplace( stringVal, " ", MESSAGE_SPACE_PADDING, true ) ] )
return true
}

Expand Down Expand Up @@ -773,6 +773,6 @@ void function ReceiveNewDamageSourceIDs( array<string> args )
{
// IDs are inserted to the custom list in triplets, so we can trust these indices exist and the loop will end properly
for ( int i = 0; i < args.len(); i += 3 )
RegisterWeaponDamageSourceInternal( args[ i ].tointeger(), args[ i + 1 ], StringReplace( args[ i + 2 ], MESSAGE_SPACE_PADDING, " " ) )
RegisterWeaponDamageSourceInternal( args[ i ].tointeger(), args[ i + 1 ], StringReplace( args[ i + 2 ], MESSAGE_SPACE_PADDING, " ", true ) )
}
#endif

0 comments on commit 7aa3958

Please sign in to comment.