Skip to content

Commit e8f0dd1

Browse files
committed
Fixed a second issue with /simc output with very specific names that include |
1 parent 79333b7 commit e8f0dd1

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

modules/SimulationCraft.lua

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,19 @@ function Module:PrintSimcProfile()
7070
text = text:gsub("# Checksum: %x+$", "");
7171

7272
local customLoadoutsString = "";
73+
local customLoadoutsChecksumString = "";
7374
for _, loadout in ipairs(GlobalAPI:GetLoadouts()) do
7475
if not loadout.isBlizzardLoadout or not loadout.playerIsOwner then
7576
local importString = GlobalAPI:GetExportString(loadout.id, true);
7677
customLoadoutsString = string.format(
7778
"%s# Saved Loadout: %s\n# talents=%s\n",
7879
customLoadoutsString,
80+
loadout.name,
81+
importString
82+
);
83+
customLoadoutsChecksumString = string.format(
84+
"%s# Saved Loadout: %s\n# talents=%s\n",
85+
customLoadoutsChecksumString,
7986
loadout.name:gsub("||", "|"),
8087
importString
8188
);
@@ -84,12 +91,9 @@ function Module:PrintSimcProfile()
8491

8592
if customLoadoutsString == "" then return; end
8693

87-
-- append the custom loadouts to the end of the simc profile
88-
text = text .. customLoadoutsString .. "\n"
89-
9094
-- calculate the new checksum
91-
local checksum = adler32(text);
92-
text = text .. "# Checksum: " .. string.format('%x', checksum);
95+
local checksum = adler32(text .. customLoadoutsChecksumString .. "\n");
96+
text = text .. customLoadoutsString .. "\n" .. "# Checksum: " .. string.format('%x', checksum);
9397

9498
-- update the simc edit box
9599
SimcEditBox:SetText(text);

0 commit comments

Comments
 (0)