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

Commit 2f06dc8

Browse files
committed
More stable fixing
1 parent affd487 commit 2f06dc8

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//50
1+
//51
22
//
33
// This code was generated by a tool. Any changes made manually will be lost
44
// the next time this code is regenerated.
55
//
66

77
using System.Reflection;
88

9-
[assembly: AssemblyFileVersion("1.13.7.50")]
10-
[assembly: AssemblyVersion("1.13.7.50")]
9+
[assembly: AssemblyFileVersion("1.13.7.51")]
10+
[assembly: AssemblyVersion("1.13.7.51")]

EssentialsPlugin/Utility/Protection.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
using Sandbox.ModAPI;
1111
using SEModAPIInternal.API.Common;
1212
using VRage.Game;
13-
using VRage.Game.Entity.EntityComponents;
1413
using VRage.Game.ModAPI;
1514

1615
public class Protection
@@ -61,16 +60,16 @@ private void OnBlockAdded( MySlimBlock block )
6160
if ( protectionItem == null || !protectionItem.Enabled || !protectionItem.ProtectBockAdd )
6261
return;
6362

64-
if ( block.OwnerId != 0 )
63+
if ( block.FatBlock!=null && block.FatBlock.OwnerId != 0 )
6564
{
66-
var steamId = PlayerMap.Instance.GetSteamIdFromPlayerId( block.OwnerId );
65+
var steamId = PlayerMap.Instance.GetSteamIdFromPlayerId( block.FatBlock.OwnerId );
6766
//if ( PlayerManager.Instance.IsUserAdmin( steamId ) )
6867
// return;
6968

7069
Communication.Notification( steamId, MyFontEnum.Red, 5, protectionItem.ProtectBlockWarning ?? "You cannot add blocks to this grid!" );
7170
}
7271
MyAPIGateway.Utilities.InvokeOnGameThread(()=>block.CubeGrid.RazeBlock( block.Position ));
73-
Essentials.Log.Info( $"Removed block from protected grid {protectionItem.EntityId}. Block owner: {PlayerMap.Instance.GetPlayerNameFromPlayerId( block.OwnerId )}" );
72+
Essentials.Log.Info( $"Removed block from protected grid {protectionItem.EntityId}. Block owner: {PlayerMap.Instance.GetPlayerNameFromPlayerId( block.FatBlock?.OwnerId ?? 0 )}" );
7473
}
7574

7675
private void DamageHandler( object target, ref MyDamageInformation info )

0 commit comments

Comments
 (0)