Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #443 - Fix for default duty not working if set to false #450

Merged
merged 1 commit into from
Apr 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion server/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,15 @@ function CheckPlayerData(source, playerData)
local job = GetJob(playerData.job?.name) or GetJob('unemployed')
assert(job ~= nil, 'Unemployed job not found. Does it exist in shared/jobs.lua?')
local jobGrade = GetJob(playerData.job?.name) and playerData.job.grade.level or 0
if QBX.Shared.ForceJobDefaultDutyAtLogin and (job.defaultDuty ~= nil) then
playerData.job.onduty = job.defaultDuty
end
playerData.job = {
name = playerData.job?.name or 'unemployed',
label = job.label,
payment = job.grades[jobGrade].payment or 0,
type = job.type,
onduty = QBX.Shared.ForceJobDefaultDutyAtLogin and job.defaultDuty or playerData.job?.onduty or false,
onduty = playerData.job?.onduty or false,
isboss = job.grades[jobGrade].isboss or false,
grade = {
name = job.grades[jobGrade].name,
Expand Down