HandyNotes: Visions of N'Zoth

HandyNotes: Visions of N'Zoth

4M Downloads

Miss use of unpack

Dairyman opened this issue ยท 2 comments

commented

The use of unpack here will only return one value not all values.

return {
ELEMENTAL_STORM_MOB_ACHIVEMENTS['all'],
Section(L['elemental_storm_thunderstorm']), -- Thunderstorm Rewards
getStormAchievement(self.mapID, 'thunderstorm'),
ELEMENTAL_STORM_BOSS_ACHIEVEMENTS['thunderstorm'],
ELEMENTAL_STORM_PET_REWARDS['thunderstorm'],
ELEMENTAL_STORM_FORMULA_REWARDS['thunderstorm'],
unpack(ELEMENTAL_STORM_TRANSMOG_REWARDS['thunderstorm']), Spacer(),
Section(L['elemental_storm_sandstorm']), -- Sandstorm Rewards
getStormAchievement(self.mapID, 'sandstorm'),
ELEMENTAL_STORM_BOSS_ACHIEVEMENTS['sandstorm'],
ELEMENTAL_STORM_PET_REWARDS['sandstorm'],
ELEMENTAL_STORM_FORMULA_REWARDS['sandstorm'],
unpack(ELEMENTAL_STORM_TRANSMOG_REWARDS['sandstorm']), Spacer(),
Section(L['elemental_storm_firestorm']), -- Firestorm Rewards
getStormAchievement(self.mapID, 'firestorm'),
ELEMENTAL_STORM_BOSS_ACHIEVEMENTS['firestorm'],
ELEMENTAL_STORM_PET_REWARDS['firestorm'],
ELEMENTAL_STORM_FORMULA_REWARDS['firestorm'],
unpack(ELEMENTAL_STORM_TRANSMOG_REWARDS['firestorm']), Spacer(),
Section(L['elemental_storm_snowstorm']), -- Snowstorm Rewards
getStormAchievement(self.mapID, 'snowstorm'),
ELEMENTAL_STORM_BOSS_ACHIEVEMENTS['snowstorm'],
ELEMENTAL_STORM_PET_REWARDS['snowstorm'],
ELEMENTAL_STORM_FORMULA_REWARDS['snowstorm'],
unpack(ELEMENTAL_STORM_TRANSMOG_REWARDS['snowstorm']), Spacer(),
ELEMENTAL_STORM_FORMULA_REWARDS['all']
}

See:

print(unpack({1, 2, 3, 4}) -- prints: 1 2 3 4

print(1, unpack({2, 3, 4}), 5) -- prints: 1 2 5
commented

local rewards = {
ELEMENTAL_STORM_MOB_ACHIVEMENTS['all'], Spacer(),
Achievement({
id = ELEMENTAL_STORM_MOB_ACHIVEMENTS[mapID][stormType],
criteria = {
id = 1,
qty = true,
suffix = L['empowered_mobs_killed_suffix']
}
}), ELEMENTAL_STORM_BOSS_ACHIEVEMENTS[stormType],
ELEMENTAL_STORM_PET_REWARDS[stormType],
ELEMENTAL_STORM_FORMULA_REWARDS['all'],
ELEMENTAL_STORM_FORMULA_REWARDS[stormType],
unpack(ELEMENTAL_STORM_TRANSMOG_REWARDS[stormType])
}

There is one more.

commented

One of our coders says that is not a problem the line 1500 because is the last thing in the table.