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

Commit

Permalink
Fix powers if they are over max level
Browse files Browse the repository at this point in the history
  • Loading branch information
ShamblesSM committed Feb 2, 2023
1 parent 5c83131 commit 836ddda
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Configs/Power.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ end
---Updates the currentLevel value.
function Power:updateCurrentLevel()
local profile = _Game:getCurrentProfile()
self.currentLevel = (profile and profile:getPowerLevel(self._name)) or 1
if profile:getPowerLevel(self._name) > self.maxLevel then
_Log:printt("Power", "Power "..self._name.." is over max level!")
self.currentLevel = self.maxLevel
profile.powerCatalog[self._name].level = self.maxLevel
else
self.currentLevel = (profile and profile:getPowerLevel(self._name)) or 1
end
end


Expand Down

0 comments on commit 836ddda

Please sign in to comment.