Skip to content

Commit

Permalink
Pass wsID to xi.weaponskills.takeWeaponskillDamage()
Browse files Browse the repository at this point in the history
Before this patch, PUP's Automaton's ranged attack and weaponskill shows 0
damage done because of an error in xi.weaponskills.takeWeaponskillDamage():

[map][error] luautils::onUseWeaponSkill: ./scripts/globals/weaponskills.lua:1012: bad argument #1 to 'lshift' (number expected, got nil)

Strangely enough, Atonement still correctly shows its damage even though
it causes the same error, fix this by passing wsID to xi.weaponskills.takeWeaponskillDamage()
as expected.
  • Loading branch information
kelppo committed Oct 17, 2023
1 parent 2d5c912 commit 5afa98f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/actions/weaponskills/atonement.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ weaponskillObject.onUseWeaponSkill = function(player, target, wsID, tp, primary,
}
local calcParams =
{
wsID = wsID,
criticalHit = false,
tpHitsLanded = 0,
extraHitsLanded = 0,
Expand Down
2 changes: 2 additions & 0 deletions scripts/globals/automatonweaponskills.lua
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ xi.autows.doAutoPhysicalWeaponskill = function(attacker, target, wsID, tp, prima
}

local calcParams = {}
calcParams.wsID = wsID
calcParams.weaponDamage = xi.weaponskills.getMeleeDmg(attacker, attack.weaponType, wsParams.kick)
calcParams.attackInfo = attack
calcParams.fSTR = utils.clamp(attacker:getStat(xi.mod.STR) - target:getStat(xi.mod.VIT), -10, 10)
Expand Down Expand Up @@ -282,6 +283,7 @@ xi.autows.doAutoRangedWeaponskill = function(attacker, target, wsID, wsParams, t

local calcParams =
{
wsID = wsID,
weaponDamage = { wsParams.weaponDamage or rangedDamage },
attackInfo = attack,
fSTR = utils.clamp(attacker:getStat(xi.mod.STR) - target:getStat(xi.mod.VIT), -10, 10),
Expand Down

0 comments on commit 5afa98f

Please sign in to comment.