From 2a1a8c63577c21223df90fa1afbfe99d6c13ed76 Mon Sep 17 00:00:00 2001 From: konaka <> Date: Sun, 9 Nov 2025 12:42:21 +0800 Subject: [PATCH] Fix data corruption when user pair an elder DLL --- UnitXP_SP3_Addon.lua | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/UnitXP_SP3_Addon.lua b/UnitXP_SP3_Addon.lua index a3e061b..ad01de0 100755 --- a/UnitXP_SP3_Addon.lua +++ b/UnitXP_SP3_Addon.lua @@ -214,6 +214,12 @@ local function UnitXP_SP3_combatTextSP3(enable) return false; end + if type(result) ~= "boolean" then + result = false; + UnitXP_SP3_Print( + "UnitXP_SP3.dll failed to execute \"combatTextSP3\". You might need to update UnitXP_SP3.dll to support this method."); + end + return result; end @@ -238,6 +244,12 @@ local function UnitXP_SP3_combatTextSP3_fontSize(size) return UnitXP_SP3_Addon["combatTextSP3_fontSize"]; end + if type(result) ~= "number" then + result = 40; + UnitXP_SP3_Print( + "UnitXP_SP3.dll failed to execute \"combatTextSP3 setFontSize\". You might need to update UnitXP_SP3.dll to support this method."); + end + UnitXP_SP3_Addon["combatTextSP3_fontSize"] = result; return UnitXP_SP3_Addon["combatTextSP3_fontSize"]; end @@ -254,6 +266,12 @@ local function UnitXP_SP3_combatTextSP3_fontName(name) return UnitXP_SP3_Addon["combatTextSP3_fontName"]; end + if type(result) ~= "string" then + result = "Cambria"; + UnitXP_SP3_Print( + "UnitXP_SP3.dll failed to execute \"combatTextSP3 setFontName\". You might need to update UnitXP_SP3.dll to support this method."); + end + UnitXP_SP3_Addon["combatTextSP3_fontName"] = result; return UnitXP_SP3_Addon["combatTextSP3_fontName"]; end @@ -270,6 +288,12 @@ local function UnitXP_SP3_combatTextSP3_nameplateHeight(size) return UnitXP_SP3_Addon["combatTextSP3_nameplateHeight"]; end + if type(result) ~= "number" then + result = 55; + UnitXP_SP3_Print( + "UnitXP_SP3.dll failed to execute \"combatTextSP3 setNameplateHeight\". You might need to update UnitXP_SP3.dll to support this method."); + end + UnitXP_SP3_Addon["combatTextSP3_nameplateHeight"] = result; return UnitXP_SP3_Addon["combatTextSP3_nameplateHeight"]; end @@ -827,7 +851,7 @@ end function UnitXP_SP3_OnEvent(event) if event == "ADDON_LOADED" and arg1 == "UnitXP_SP3_Addon" then - local dataVersion = 32; + local dataVersion = 33; if UnitXP_SP3_Addon == nil or UnitXP_SP3_Addon["dataVersion"] ~= dataVersion then UnitXP_SP3_Addon = {}; UnitXP_SP3_Addon["dataVersion"] = dataVersion;