Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Fix robux pet evolving bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Pluviolithic committed Nov 21, 2023
1 parent a47e246 commit 79b73cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/server/Combat/Perks/Pets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local function evolvePet(player, petName)

if unlockedPetCount < 5 then
local countToUnlock = 5 - unlockedPetCount
if countToUnlock > (petOwnedCount - equippedPets[petName]) then
if countToUnlock > (petOwnedCount - (equippedPets[petName] or 0)) then
store:dispatch(
actions.unequipPlayerPets(
player.Name,
Expand All @@ -37,6 +37,10 @@ local function evolvePet(player, petName)
store:dispatch(actions.deletePlayerPets(player.Name, { [petName] = 5 }, true))
store:dispatch(actions.givePlayerPets(player.Name, { ["Evolved " .. petName] = 1 }))

if petUtils.getPet(petName):FindFirstChild "PermaLock" then
store:dispatch(actions.lockPlayerPets(player.Name, { ["Evolved " .. petName] = 1 }))
end

return 0
end

Expand Down
5 changes: 4 additions & 1 deletion src/shared/State/Reducer/Stats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ return Rodux.createReducer({}, {
end,
deletePlayerPets = function(state, action)
local removedPetCount = 0
for _, quantity in action.petsToDelete do
for petName, quantity in action.petsToDelete do
if petUtils.getPet(petName):FindFirstChild "PermaLock" then
continue
end
removedPetCount -= quantity
end
return produce(state, function(draft)
Expand Down

0 comments on commit 79b73cd

Please sign in to comment.