mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Merge pull request #13274 from Heroman3003/pto-fixes
Minor fixes to Talon playhours
This commit is contained in:
@@ -59,11 +59,12 @@ SUBSYSTEM_DEF(persist)
|
|||||||
var/client/C = M.client
|
var/client/C = M.client
|
||||||
var/wait_in_hours = wait / (1 HOUR)
|
var/wait_in_hours = wait / (1 HOUR)
|
||||||
var/pto_factored = wait_in_hours * J.timeoff_factor
|
var/pto_factored = wait_in_hours * J.timeoff_factor
|
||||||
|
if(J.playtime_only)
|
||||||
|
pto_factored = 0
|
||||||
LAZYINITLIST(C.department_hours)
|
LAZYINITLIST(C.department_hours)
|
||||||
LAZYINITLIST(C.play_hours)
|
LAZYINITLIST(C.play_hours)
|
||||||
var/dept_hours = C.department_hours
|
var/dept_hours = C.department_hours
|
||||||
var/play_hours = C.play_hours
|
var/play_hours = C.play_hours
|
||||||
if(!(J.playtime_only))
|
|
||||||
if(isnum(dept_hours[department_earning]))
|
if(isnum(dept_hours[department_earning]))
|
||||||
dept_hours[department_earning] += pto_factored
|
dept_hours[department_earning] += pto_factored
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
if(C && config.use_playtime_restriction_for_jobs && dept_time_required)
|
if(C && config.use_playtime_restriction_for_jobs && dept_time_required)
|
||||||
var/remaining_time_needed = dept_time_required
|
var/remaining_time_needed = dept_time_required
|
||||||
for(var/key in C.play_hours)
|
for(var/key in C.play_hours)
|
||||||
if(isnum(C.play_hours[key]))
|
if(isnum(C.play_hours[key]) && !(key == PTO_TALON))
|
||||||
remaining_time_needed = max(0, remaining_time_needed - C.play_hours[key])
|
remaining_time_needed = max(0, remaining_time_needed - C.play_hours[key])
|
||||||
return remaining_time_needed
|
return remaining_time_needed
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user