Skip to content

Commit

Permalink
Update Badger
Browse files Browse the repository at this point in the history
Remove check in badger.award() for if the player has the badge already, as this should be implemented by the developer as an if statement before making the call to award. This is being done to make the success bool returned, will always be a BadgeService error if its false.
  • Loading branch information
gaymeowing authored Dec 19, 2024
1 parent 1214683 commit a12e7dd
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions libs/badger/init.luau
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,13 @@ function badger.award(player: Player, badge: Badge): boolean
local info = GET_INFO(player)

if info then
if HAS_BADGE(player, badge, info) then
return true
else
local success = AWARD(BadgeService, player.UserId, badge.id)
info = PLAYER_INFOS[player]
local success = AWARD(BadgeService, player.UserId, badge.id)
info = PLAYER_INFOS[player]

if success and info then
info.owned[badge.id] = true
end
return success
if success and info then
info.owned[badge.id] = true
end
return success
else
return false
end
Expand Down

0 comments on commit a12e7dd

Please sign in to comment.