File tree Expand file tree Collapse file tree
Scripts/CATHODE/CommandsPAK/Helpers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 <Authors >Matt Filer</Authors >
1111 <Description >Provides support for parsing and writing common Alien: Isolation formats from the Cathode engine.</Description >
1212 <Copyright >Matt Filer 2025</Copyright >
13- <Version >0.8.2 </Version >
13+ <Version >0.8.3 </Version >
1414 <OutputType >Library</OutputType >
15- <AssemblyVersion >0.7.8.2 </AssemblyVersion >
15+ <AssemblyVersion >0.7.8.3 </AssemblyVersion >
1616 <FileVersion >0.7.8.2</FileVersion >
1717 <AllowUnsafeBlocks >False</AllowUnsafeBlocks >
1818 <PackageReadmeFile >README.md</PackageReadmeFile >
Original file line number Diff line number Diff line change @@ -122,23 +122,17 @@ public static string FindString(ShortGuid guid)
122122 /* Generate a random unique ShortGuid */
123123 public static ShortGuid GenerateRandom ( )
124124 {
125- string str = DateTime . Now . ToString ( "G" ) ;
125+ string str = Guid . NewGuid ( ) . ToString ( ) ;
126126 ShortGuid guid = Generate ( str , false ) ;
127- int i = 0 ;
128- int c_i = 0 ;
127+ int s = 0 ;
129128 while ( _vanilla . cache . ContainsKey ( str ) || _custom . cache . ContainsKey ( str ) || _vanilla . cacheReversed . ContainsKey ( guid ) || _custom . cacheReversed . ContainsKey ( guid ) )
130129 {
131- str = guid . ToByteString ( ) ;
132- if ( i > 1000 )
133- {
134- str += ( char ) c_i ;
135- c_i ++ ;
136- i = 0 ;
137- }
130+ str = $ "{ str } _{ s ++ } ";
138131 guid = Generate ( str , false ) ;
139- i ++ ;
132+
133+ if ( s > 10000 ) throw new Exception ( "Failed to generate unique ShortGuid after many attempts." ) ;
140134 }
141- // Cache(guid, str);
135+ Cache ( guid , str ) ;
142136 return guid ;
143137 }
144138
You can’t perform that action at this time.
0 commit comments