private void OnRenamed(object source, RenamedEventArgs e) { // Specify what is done when a file is renamed. Logger.DebugFormat("File: {0} renamed to {1}", e.OldFullPath, e.FullPath); if (!e.FullPath.EndsWith(".bak")) { if (File.Exists(e.FullPath)) { if (GlobalSettings.PreviousStashStatus == StashAvailability.CRAFTING || GlobalSettings.StashStatus == StashAvailability.CRAFTING) { Logger.Info("Detected an update to stash file, but ignoring due to crafting-safety-check"); // OBS: Can only do this if we've previously looted! CAnnot risk it containing unlooted items if (StashManager._hasLootedItemsOnceThisSession) { if (_delayedLootTimer == null) { Logger.Info( "Items has already been looted this session, post-crafting safety measures required."); StashManager.DeleteItemsInPageX(e.FullPath); } else { Logger.Info("Player may have opened devotion screen before running away.. leaving items be.."); } } else { Logger.Info("No items has been looted this session, ignoring safety measures."); } } else { Logger.Info("Detected an update to stash file, checking for loot.."); NotifyStashChangeDelayed(e.FullPath); } } else { Logger.Warn("Detected an update to stash file, but stash file does not appear to exist."); } } }