Skip to content

Commit

Permalink
mine sync
Browse files Browse the repository at this point in the history
  • Loading branch information
xianson committed Sep 16, 2024
1 parent 89def56 commit 566edd0
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,7 @@ protected override void UnloadData()

private void OnMissileCollided(IMyMissile missile)
{

if(IsMine(missile) && missile.CollisionPoint != null && missile.CollidedEntity is IMyVoxelBase)
if (MyAPIGateway.Session.IsServer && IsMine(missile) && missile.CollisionPoint != null && missile.CollidedEntity is IMyVoxelBase)
{
MatrixD matrix = MatrixD.CreateFromDir(-missile.CollisionNormal);
matrix.Translation = (Vector3D)missile.CollisionPoint;
Expand Down Expand Up @@ -480,7 +479,7 @@ public Mine(MatrixD initialMatrix, string modelPath, float damage, float explosi
this.WorldMatrix = initialMatrix;
this.AddToGamePruningStructure();
this.Flags |= EntityFlags.IsGamePrunningStructureObject;

(this as IMyEntity).Synchronized = true;
this.damage = damage;
this.explosion_radius = explosion_radius;
this.detection_radius = detection_radius;
Expand Down

0 comments on commit 566edd0

Please sign in to comment.