job transfers now correctly update job slots

This commit is contained in:
Kyep
2019-04-29 20:10:06 -07:00
parent 6d0d7ae506
commit 97e53916f6
3 changed files with 12 additions and 1 deletions
+9
View File
@@ -624,6 +624,15 @@ SUBSYSTEM_DEF(jobs)
id_change_records["[id_change_counter]"] = list("transferee" = transferee, "oldvalue" = oldvalue, "newvalue" = newvalue, "whodidit" = whodidit, "timestamp" = station_time_timestamp())
id_change_counter++
/datum/controller/subsystem/jobs/proc/slot_job_transfer(oldtitle, newtitle)
var/datum/job/oldjobdatum = SSjobs.GetJob(oldtitle)
var/datum/job/newjobdatum = SSjobs.GetJob(newtitle)
if(istype(oldjobdatum) && oldjobdatum.current_positions > 0 && istype(newjobdatum))
if(!(oldjobdatum.title in command_positions) && !(newjobdatum.title in command_positions))
oldjobdatum.current_positions--
newjobdatum.current_positions++
/datum/controller/subsystem/jobs/proc/fetch_transfer_record_html(var/centcom)
var/record_html = "<TABLE border=\"1\">"
+1 -1
View File
@@ -408,6 +408,7 @@ var/time_last_changed_position = 0
message_admins("[key_name_admin(usr)] has reassigned \"[modify.registered_name]\" from \"[jobnamedata]\" to \"[t1]\".")
SSjobs.log_job_transfer(modify.registered_name, jobnamedata, t1, scan.registered_name)
SSjobs.slot_job_transfer(modify.rank, t1)
var/mob/living/carbon/human/H = modify.getPlayer()
if(istype(H))
@@ -416,7 +417,6 @@ var/time_last_changed_position = 0
if(H.mind)
H.mind.playtime_role = t1
modify.access = access
modify.rank = t1
modify.assignment = t1
@@ -250,6 +250,8 @@
message_admins("[key_name_admin(usr)] has reassigned \"[modify.registered_name]\" from \"[jobnamedata]\" to \"[t1]\".")
SSjobs.log_job_transfer(modify.registered_name, jobnamedata, t1, scan.registered_name)
SSjobs.slot_job_transfer(modify.rank, t1)
var/mob/living/carbon/human/H = modify.getPlayer()
if(istype(H))
if(jobban_isbanned(H, t1))