Ejemplo n.º 1
0
 internal static void ApplyWarp(Configs.Warp warp)
 {
     try
     {
         if (!string.IsNullOrEmpty(warp.Conditions) && !Conditions.CheckConditionList(warp.Conditions, AdvancedLocationLoaderMod.ConditionResolver))
         {
             AdvancedLocationLoaderMod.Logger.Log(warp.ToString() + "~> false", LogLevel.Trace);
             return;
         }
         Warp         _warp = new Warp(warp.TileX, warp.TileY, warp.TargetName, warp.TargetX, warp.TargetY, false);
         GameLocation loc   = Game1.getLocationFromName(warp.MapName);
         loc.warps.RemoveAll((a) => a.X == _warp.X && a.Y == _warp.Y);
         loc.warps.Add(_warp);
         AdvancedLocationLoaderMod.Logger.Log(warp.ToString() + "~> true", LogLevel.Trace);
     }
     catch (Exception err)
     {
         AdvancedLocationLoaderMod.Logger.ExitGameImmediately("Unable to patch warp, a unexpected error occured: " + warp.ToString(), err);
     }
 }
Ejemplo n.º 2
0
 internal static void ApplyWarp(Configs.Warp warp)
 {
     try
     {
         if (!string.IsNullOrEmpty(warp.Conditions) && !ModEntry.SHelper.Conditions().ValidateConditions(warp.Conditions))
         {
             return;
         }
         Warp         _warp = new Warp(warp.TileX, warp.TileY, warp.TargetName, warp.TargetX, warp.TargetY, false);
         GameLocation loc   = Game1.getLocationFromName(warp.MapName);
         loc.warps.RemoveAll((a) => a.X == _warp.X && a.Y == _warp.Y);
         loc.warps.Add(_warp);
     }
     catch (Exception err)
     {
         ModEntry.Logger.ExitGameImmediately("Unable to patch warp, a unexpected error occured: " + warp.ToString(), err);
     }
 }