mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-23 05:07:51 +01:00
Merge pull request #1695 from CHOMPStationBot/upstream-merge-10036
[MIRROR] Makes modifying ID cards not change the department if rank wasn't changed
This commit is contained in:
+12
-6
@@ -302,7 +302,7 @@ var/global/list/PDA_Manifest = list()
|
||||
manifest_inject(H)
|
||||
return
|
||||
|
||||
/datum/datacore/proc/manifest_modify(var/name, var/assignment)
|
||||
/datum/datacore/proc/manifest_modify(var/name, var/assignment, var/rank)
|
||||
ResetPDAManifest()
|
||||
var/datum/data/record/foundrecord
|
||||
var/real_title = assignment
|
||||
@@ -316,11 +316,17 @@ var/global/list/PDA_Manifest = list()
|
||||
var/list/all_jobs = get_job_datums()
|
||||
|
||||
for(var/datum/job/J in all_jobs)
|
||||
var/list/alttitles = get_alternate_titles(J.title)
|
||||
if(!J) continue
|
||||
if(assignment in alttitles)
|
||||
real_title = J.title
|
||||
if(J.title == rank) //If we have a rank, just default to using that.
|
||||
real_title = rank
|
||||
break
|
||||
else if(J.title == assignment)
|
||||
real_title = assignment
|
||||
break
|
||||
else
|
||||
var/list/alttitles = get_alternate_titles(J.title)
|
||||
if(assignment in alttitles)
|
||||
real_title = J.title
|
||||
break
|
||||
|
||||
if(foundrecord)
|
||||
foundrecord.fields["rank"] = assignment
|
||||
@@ -333,7 +339,7 @@ var/global/list/PDA_Manifest = list()
|
||||
var/datum/job/J = SSjob.get_job(H.mind.assigned_role)
|
||||
hidden = J?.offmap_spawn
|
||||
|
||||
/* Note: Due to cached_character_icon, a number of emergent properties occur due to the initialization
|
||||
/* Note: Due to cached_character_icon, a number of emergent properties occur due to the initialization
|
||||
* order of readied-up vs latejoiners. Namely, latejoiners will get a uniform in their datacore picture, but readied-up will
|
||||
* not. This is due to the fact that SSticker calls data_core.manifest_inject() inside of ticker/proc/create_characters(),
|
||||
* but does not equip them until ticker/proc/equip_characters(), which is called later. So, this proc is literally called before
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
switch(action)
|
||||
if("modify")
|
||||
if(modify)
|
||||
data_core.manifest_modify(modify.registered_name, modify.assignment)
|
||||
data_core.manifest_modify(modify.registered_name, modify.assignment, modify.rank)
|
||||
modify.name = "[modify.registered_name]'s ID Card ([modify.assignment])"
|
||||
if(ishuman(usr))
|
||||
modify.forceMove(get_turf(src))
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
card.rank = newjob.title
|
||||
card.assignment = newassignment
|
||||
card.name = text("[card.registered_name]'s ID Card ([card.assignment])")
|
||||
data_core.manifest_modify(card.registered_name, card.assignment)
|
||||
data_core.manifest_modify(card.registered_name, card.assignment, card.rank)
|
||||
card.last_job_switch = world.time
|
||||
callHook("reassign_employee", list(card))
|
||||
newjob.current_positions++
|
||||
@@ -203,7 +203,7 @@
|
||||
card.rank = ptojob.title
|
||||
card.assignment = ptojob.title
|
||||
card.name = text("[card.registered_name]'s ID Card ([card.assignment])")
|
||||
data_core.manifest_modify(card.registered_name, card.assignment)
|
||||
data_core.manifest_modify(card.registered_name, card.assignment, card.rank)
|
||||
card.last_job_switch = world.time
|
||||
callHook("reassign_employee", list(card))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
|
||||
@@ -312,14 +312,14 @@
|
||||
|
||||
writer.assignment = t1
|
||||
writer.name = text("[writer.registered_name]'s ID Card ([writer.assignment])")
|
||||
data_core.manifest_modify(writer.registered_name, writer.assignment)
|
||||
data_core.manifest_modify(writer.registered_name, writer.assignment, writer.rank)
|
||||
callHook("reassign_employee", list(writer))
|
||||
|
||||
if("reg" in href_list)
|
||||
if(auth)
|
||||
writer.registered_name = href_list["reg"]
|
||||
writer.name = text("[writer.registered_name]'s ID Card ([writer.assignment])")
|
||||
data_core.manifest_modify(writer.registered_name, writer.assignment)
|
||||
data_core.manifest_modify(writer.registered_name, writer.assignment, writer.rank)
|
||||
callHook("reassign_employee", list(writer))
|
||||
|
||||
computer.updateUsrDialog()
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
if("modify")
|
||||
if(computer && computer.card_slot)
|
||||
if(id_card)
|
||||
data_core.manifest_modify(id_card.registered_name, id_card.assignment)
|
||||
data_core.manifest_modify(id_card.registered_name, id_card.assignment, id_card.rank)
|
||||
computer.proc_eject_id(usr)
|
||||
. = TRUE
|
||||
if("terminate")
|
||||
|
||||
Reference in New Issue
Block a user