Skip to content

Commit 244ddec

Browse files
authored
Merge pull request #1488 from ab9rf/master
prevent `make-legendary` from assigning skill -1
2 parents 30993ee + ab7dc76 commit 244ddec

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Template for new versions:
3131
## New Features
3232

3333
## Fixes
34+
- `make-legendary`: ``make-legendary all`` will no longer corrupt souls
3435

3536
## Misc Improvements
3637

make-legendary.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ function getName(unit)
77
end
88

99
function legendize(unit, skill_idx)
10-
utils.insert_or_update(unit.status.current_soul.skills,
11-
{new=true, id=skill_idx, rating=df.skill_rating.Legendary5},
12-
'id')
10+
if skill_idx >= 0 and skill_idx <= df.job_skill._last_item then
11+
utils.insert_or_update(unit.status.current_soul.skills,
12+
{new=true, id=skill_idx, rating=df.skill_rating.Legendary5},
13+
'id')
14+
end
1315
end
1416

1517
function make_legendary(skillname)
@@ -50,7 +52,9 @@ function BreathOfArmok()
5052
return
5153
end
5254
for i in ipairs(df.job_skill) do
53-
legendize(unit, i)
55+
if i >= 0 then
56+
legendize(unit, i)
57+
end
5458
end
5559
print('The breath of Armok has engulfed ' .. getName(unit))
5660
end

0 commit comments

Comments
 (0)