Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when using opening wiki for skills granted by items #7309

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Classes/SkillListControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ function SkillListClass:OnHoverKeyUp(key)
-- Get the first gem in the group
local gem = item.gemList[1]
if gem then
itemLib.wiki.openGem(gem.gemData)
-- either the skill is from a gem or granted from an item/passive
itemLib.wiki.openGem(gem.gemData or gem.grantedEffect.name)
end
elseif key == "RIGHTBUTTON" then
if IsKeyDown("CTRL") then
Expand Down
12 changes: 8 additions & 4 deletions src/Modules/ItemTools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,14 @@ end
itemLib.wiki = {
key = "F1",
openGem = function(gemData)
local name = gemData.name;

if gemData.tags.support then
name = name .. " Support"
local name
if gemData.name then -- skill
name = gemData.name
if gemData.tags.support then
name = name .. " Support"
end
else -- grantedEffect from item/passive
name = gemData;
end

itemLib.wiki.open(name)
Expand Down
Loading