Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Commit 668ff5a

Browse files
committed
Use appropriate interfaces.
Addresses #14
1 parent 53b8e3a commit 668ff5a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

EssentialsPlugin/ProcessHandlers/ProcessBlockEnforcement.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Collections.Generic;
55
using EssentialsPlugin.Settings;
66
using EssentialsPlugin.Utility;
7-
using NLog;
87
using Sandbox.ModAPI;
98
using SEModAPIInternal.API.Common;
109

@@ -32,7 +31,7 @@ public override void Handle( )
3231
}
3332
catch ( Exception ex )
3433
{
35-
Log.Error( "Error handling block enforcement...", ex );
34+
Log.Error( ex );
3635
}
3736

3837
base.Handle( );
@@ -46,9 +45,9 @@ private void ScanForBlockItems( )
4645
{
4746
MyAPIGateway.Entities.GetEntities( entities );
4847
}
49-
catch
48+
catch(Exception ex)
5049
{
51-
Log.Error( "ScanForBlockItems(): Entity list busy, skipping scan." );
50+
Log.Error( "Entity list busy, skipping scan.", ex );
5251
}
5352

5453
foreach ( IMyEntity entity in entities )
@@ -66,8 +65,9 @@ private void ScanForBlockItems( )
6665
Sandbox.ModAPI.Ingame.IMyGridTerminalSystem gridTerminal = MyAPIGateway.TerminalActionsHelper.GetTerminalSystemForGrid( grid );
6766

6867
Dictionary<string, int> blocks = new Dictionary<string, int>( );
69-
foreach ( IMyTerminalBlock block in gridTerminal.Blocks )
68+
foreach ( Sandbox.ModAPI.Ingame.IMyTerminalBlock myTerminalBlock in gridTerminal.Blocks )
7069
{
70+
Sandbox.ModAPI.Ingame.IMyTerminalBlock block = myTerminalBlock;
7171
foreach ( SettingsBlockEnforcementItem item in PluginSettings.Instance.BlockEnforcementItems )
7272
{
7373
if ( !item.Enabled )

0 commit comments

Comments
 (0)