Fix data corruption when user pair an elder DLL

This commit is contained in:
konaka
2025-11-09 12:42:21 +08:00
parent 41f2a2d81b
commit 2a1a8c6357
+25 -1
View File
@@ -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;