Ejemplo n.º 1
0
 public void Remove()
 {
     try
     {
         if (AttachedEntity == null)
         {
             RadarCore.DebugWrite($"GPSMarker[{Name}].Remove", "AttachedEntity is already removed");
         }
         try
         {
             MyVisualScriptLogicProvider.RemoveGPSFromEntity(AttachedEntity.Name, Name, Description, OwnerPlayerID);
         }
         catch (Exception Scrap)
         {
             RadarCore.LogError($"GPSMarker[{Name}].Remove_VSLP", Scrap);
         }
         List <IMyGps> GPSes = MyAPIGateway.Session.GPS.GetGpsList(OwnerPlayerID);
         IMyGps        OurGPS;
         if (GPSes.Any(x => x.Name == Name && x.Description == Description, out OurGPS))
         {
             MyAPIGateway.Session.GPS.RemoveGps(OwnerPlayerID, OurGPS);
         }
         Valid = false;
     }
     catch (Exception Scrap)
     {
         RadarCore.LogError($"GPSMarker[{Name}].Remove", Scrap);
     }
 }