File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 22using System . Collections . Generic ;
33using System . Globalization ;
44using System . IO ;
5+ using System . Linq ;
56using System . Text ;
7+ using System . Text . RegularExpressions ;
68using CommandLine ;
79
810namespace patch1337tocpp {
@@ -49,11 +51,11 @@ static void Main(string[] args) {
4951 w . WriteLine ( "};" ) ;
5052 w . Write ( "struct Patch { " ) ;
5153 w . Write ( "char* ModuleName; " ) ;
52- w . Write ( "std::vector<PatchAddress> Patches " ) ;
54+ w . Write ( "std::vector<PatchAddress> Patches; " ) ;
5355 w . WriteLine ( "};" ) ;
5456
5557 foreach ( var patch in patches ) {
56- var addressableName = patch . ModuleName . Replace ( " ", "_" ) ;
58+ var addressableName = Regex . Replace ( patch . ModuleName , "([^A-Za-z0-9])+ ", "_" ) ;
5759 w . WriteLine ( $ "Patch { addressableName } ;") ;
5860 w . WriteLine ( $ "{ addressableName } .ModuleName = \" { patch . ModuleName } \" ;") ;
5961 w . WriteLine ( $ "{ addressableName } .Patches = {{") ;
You can’t perform that action at this time.
0 commit comments