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

Commit 769882f

Browse files
committed
Fix some crashes
1 parent 7607ed3 commit 769882f

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//415
1+
//418
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.415")]
10-
[assembly: AssemblyVersion("1.13.7.415")]
9+
[assembly: AssemblyFileVersion("1.13.7.418")]
10+
[assembly: AssemblyVersion("1.13.7.418")]

EssentialsPlugin/EntityManagers/EntityManagement.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using Sandbox.Game.World;
1313
using Sandbox.Game.Entities.Blocks;
1414
using Sandbox.Game.Entities.Cube;
15+
using SpaceEngineers.Game.Entities.Blocks;
1516
using SpaceEngineers.Game.ModAPI;
1617
using VRage.Collections;
1718
using VRage.Game;
@@ -310,43 +311,43 @@ private static bool CheckRevealBlockRules( MyCubeGrid grid, out string reason )
310311

311312
foreach ( var cubeBlock in grid.GetFatBlocks() )
312313
{
313-
var beacon = cubeBlock as IMyBeacon;
314+
var beacon = cubeBlock as MyBeacon;
314315
if ( beacon != null )
315316
{
316317
if ( !beacon.Enabled )
317318
continue;
318319

319320
foreach ( var player in players )
320321
{
321-
var distance = Vector3D.Distance( player.GetPosition(), beacon.GetPosition() );
322+
var distance = Vector3D.Distance( player.GetPosition(), beacon.PositionComp.GetPosition() );
322323

323-
if ( distance < beacon.Radius )
324+
if ( distance < ((IMyBeacon)beacon).Radius )
324325
{
325326
reason = $"{player.DisplayName} distance to beacon broadcast: {distance}";
326327
return true;
327328
}
328329
}
329330
}
330331

331-
var antenna = cubeBlock as IMyRadioAntenna;
332+
var antenna = cubeBlock as MyRadioAntenna;
332333
if ( antenna != null )
333334
{
334335
if ( !antenna.Enabled )
335336
continue;
336337

337338
foreach ( var player in players )
338339
{
339-
var distance = Vector3D.Distance( player.GetPosition(), antenna.GetPosition() );
340+
var distance = Vector3D.Distance( player.GetPosition(), antenna.PositionComp.GetPosition( ) );
340341

341-
if ( distance < antenna.Radius )
342+
if ( distance < antenna.GetRadius( ) )
342343
{
343344
reason = $"{player.DisplayName} distance to antenna broadcast: {distance}";
344345
return true;
345346
}
346347
}
347348
}
348349

349-
var medical = cubeBlock as IMyMedicalRoom;
350+
var medical = cubeBlock as MyMedicalRoom;
350351
if ( medical != null )
351352
{
352353
if ( !medical.Enabled || !medical.IsFunctional )

EssentialsPlugin/Utility/Communication.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ public static void SendDataMessage( ulong steamId, DataMessageType messageType,
333333
//Wrapper.GameAction( ( ) =>
334334
MySandboxGame.Static.Invoke( () =>
335335
{
336-
//MyAPIGateway.Multiplayer.SendMessageTo( 9000, newData, steamId );
337-
ServerNetworkManager.Instance.SendModMessageTo( 9000, newData, steamId );
336+
MyAPIGateway.Multiplayer.SendMessageTo( 9000, newData, steamId );
337+
//ServerNetworkManager.Instance.SendModMessageTo( 9000, newData, steamId );
338338
} );
339339
}
340340

0 commit comments

Comments
 (0)