File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,15 +80,19 @@ private void Awake()
8080 harmony = new Harmony ( "Shabby" ) ;
8181 Log . Message ( "Harmony patching" ) ;
8282 foreach ( var type in Assembly . GetExecutingAssembly ( ) . GetTypes ( ) ) {
83- PatchClassProcessor processor = new ( harmony , type ) ;
84- if ( processor . Patch ( ) is not List < MethodInfo > patchedMethods ) continue ;
85- if ( patchedMethods . Count == 0 ) {
86- Log . Message ( $ "`{ type . Name } ` skipped") ;
87- continue ;
83+ try {
84+ PatchClassProcessor processor = new ( harmony , type ) ;
85+ if ( processor . Patch ( ) is not List < MethodInfo > patchedMethods ) continue ;
86+ if ( patchedMethods . Count == 0 ) {
87+ Log . Message ( $ "`{ type . Name } ` skipped") ;
88+ continue ;
89+ }
90+
91+ Log . Message (
92+ $ "`{ type . Name } ` patched methods { string . Join ( ", " , patchedMethods . Select ( m => $ "`{ m . Name } `") ) } ") ;
93+ } catch ( Exception e ) {
94+ Log . Error ( $ "encountered exception while applying `{ type . Name } `:\n { e } ") ;
8895 }
89-
90- Log . Message (
91- $ "`{ type . Name } ` patched methods { string . Join ( ", " , patchedMethods . Select ( m => $ "`{ m . Name } `") ) } ") ;
9296 }
9397
9498 // Register as an explicit MM callback such that it is run before all reflected
You can’t perform that action at this time.
0 commit comments