Skip to content

Commit

Permalink
fix(server/player): use tonumber correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
solareon authored Aug 19, 2024
1 parent 81390de commit 9534b45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ function CreatePlayer(playerData, Offline)
---@return ErrorResult? errorResult
function self.Functions.SetJob(jobName, grade)
jobName = jobName:lower()
grade = tonumber(grade or 0)
grade = tonumber(grade) or 0
local job = GetJob(jobName)
if not job then
lib.print.error(('cannot set job. Job %s does not exist'):format(jobName))
Expand Down Expand Up @@ -622,7 +622,7 @@ function CreatePlayer(playerData, Offline)
---@return ErrorResult? errorResult
function self.Functions.SetGang(gangName, grade)
gangName = gangName:lower()
grade = tonumber(grade or 0)
grade = tonumber(grade) or 0
local gang = GetGang(gangName)
if not gang then
lib.print.error(('cannot set gang. Gang %s does not exist'):format(gangName))
Expand Down

0 comments on commit 9534b45

Please sign in to comment.