diff --git a/src/server/Combat/Perks/Pets.lua b/src/server/Combat/Perks/Pets.lua index 628bdd1..d60b906 100644 --- a/src/server/Combat/Perks/Pets.lua +++ b/src/server/Combat/Perks/Pets.lua @@ -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, @@ -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 diff --git a/src/shared/State/Reducer/Stats.lua b/src/shared/State/Reducer/Stats.lua index dffbb00..4c615bc 100644 --- a/src/shared/State/Reducer/Stats.lua +++ b/src/shared/State/Reducer/Stats.lua @@ -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)