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

[LUA] Fixes self target in "!givemagianitem" command #4551

Merged
merged 1 commit into from
Sep 30, 2023
Merged
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
4 changes: 2 additions & 2 deletions scripts/commands/givemagianitem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ commandObj.onTrigger = function(player, target, trialId, isRewardItem)
player:PrintToPlayer(string.format('Player \'%s\' does not have free space for that item!', target))
else
if giveRewardItem then
xi.magian.giveRewardItem(player, trialId)
xi.magian.giveRewardItem(target, trialId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't an entirely accurate fix, and only half-implements your desired intent. I'm fine with requiring a target, but you didn't update the else condition, which in this case, giveRewardItem bool determines if its the requiredItem or rewardItem in the magian table.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the additional player to target

else
xi.magian.giveRequiredItem(player, trialId)
xi.magian.giveRequiredItem(target, trialId)
end

player:PrintToPlayer(string.format('Gave player \'%s\' Item for Trial ID \'%u\' ', target, trialId))
Expand Down