Fix depthours requirement for never-used departments

This commit is contained in:
Arokha Sieyes
2020-05-11 01:05:35 -04:00
parent b1bdcfaa3c
commit e2bf78a196
+5 -2
View File
@@ -25,6 +25,9 @@
return (available_in_playhours(C) == 0)
/datum/job/proc/available_in_playhours(client/C)
if(C && config.use_playtime_restriction_for_jobs && isnum(C.play_hours[pto_type]) && dept_time_required > 0)
return max(0, dept_time_required - C.play_hours[pto_type])
if(C && config.use_playtime_restriction_for_jobs)
if(isnum(C.play_hours[pto_type])) // Has played that department before
return max(0, dept_time_required - C.play_hours[pto_type])
else // List doesn't have that entry, maybe never played, maybe invalid PTO type (you should fix that...)
return dept_time_required // Could be 0, too, which is fine! They can play that
return 0