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: duplicated daily rewards bug #2503

Merged
merged 2 commits into from
Apr 1, 2024
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
10 changes: 4 additions & 6 deletions data/modules/scripts/daily_reward/daily_reward.lua
Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,12 @@ function Player.selectDailyReward(self, msg)
local description = ""
for k, v in ipairs(items) do
if dailyTable.itemCharges then
for i = 1, rewardCount do
local inboxItem = inbox:addItem(v.itemId, dailyTable.itemCharges) -- adding charges for each item
if inboxItem then
inboxItem:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime())
end
local inboxItem = inbox:addItem(v.itemId, dailyTable.itemCharges) -- adding charges for each item
if inboxItem then
inboxItem:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime())
end
else
local inboxItem = inbox:addItem(v.itemId, rewardCount) -- adding single item w/o charges
local inboxItem = inbox:addItem(v.itemId, v.count) -- adding single item w/o charges
if inboxItem then
inboxItem:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime())
end
Expand Down
Loading