File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,6 +125,20 @@ public override void HandleAddedToManager(PluginManager manager)
125125 Subscribe ( hookname ) ;
126126 }
127127
128+ try
129+ {
130+ // Let the plugin know that it is loading
131+ OnCallHook ( "Init" , null ) ;
132+ }
133+ catch ( Exception ex )
134+ {
135+ Interface . Oxide . LogException ( $ "Failed to initialize plugin '{ Name } v{ Version } '", ex ) ;
136+ if ( Loader != null )
137+ {
138+ Loader . PluginErrors [ Name ] = ex . Message ;
139+ }
140+ }
141+
128142 // Find all classes with the AutoPatch attribute and apply the patches
129143 foreach ( Type nestedType in GetType ( ) . GetNestedTypes ( BindingFlags . DeclaredOnly | BindingFlags . Public | BindingFlags . NonPublic | BindingFlags . Static ) )
130144 {
@@ -154,20 +168,6 @@ public override void HandleAddedToManager(PluginManager manager)
154168 Interface . Oxide . LogException ( $ "[{ Title } ] Failed to automatically Harmony patch '{ nestedType . Name } '", ex ) ;
155169 }
156170 }
157-
158- try
159- {
160- // Let the plugin know that it is loading
161- OnCallHook ( "Init" , null ) ;
162- }
163- catch ( Exception ex )
164- {
165- Interface . Oxide . LogException ( $ "Failed to initialize plugin '{ Name } v{ Version } '", ex ) ;
166- if ( Loader != null )
167- {
168- Loader . PluginErrors [ Name ] = ex . Message ;
169- }
170- }
171171 }
172172
173173 /// <summary>
You can’t perform that action at this time.
0 commit comments