Skip to content

Commit

Permalink
fix: flip version check logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kalilistic committed Oct 10, 2023
1 parent 69b6897 commit a2a8d84
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Dalamud.DrunkenToad/Extensions/PluginInterfaceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ public static bool IsDifferentVersionLoaded(this DalamudPluginInterface value, s
var internalName = value.InternalName;
if (!internalName.EndsWith(version, StringComparison.CurrentCulture))
{
return PluginNotLoaded(value, $"{internalName}{version}");
return IsPluginLoaded(value, $"{internalName}{version}");
}

var stableName = internalName.Replace(version, string.Empty);
return PluginNotLoaded(value, stableName);
return IsPluginLoaded(value, stableName);
}

private static bool PluginNotLoaded(DalamudPluginInterface pluginInterface, string pluginName)
private static bool IsPluginLoaded(DalamudPluginInterface pluginInterface, string pluginName)
{
var plugin = pluginInterface.InstalledPlugins.FirstOrDefault(p => p.Name == pluginName);
return plugin == null || !plugin.IsLoaded;
return plugin != null && plugin.IsLoaded;
}
}

0 comments on commit a2a8d84

Please sign in to comment.