[MIRROR] (Fix) The crew manifest now properly updates after ID modifications. [MDB IGNORE] (#20370)

* (Fix) The crew manifest now properly updates after ID modifications. (#74518)

## About The Pull Request
This PR makes it so that the access modification program now updates the
crew manifest once the inserted ID is ejected. Additionally, when the ID
trim is changed, the manifest is updated.
## Why It's Good For The Game
Demoted heads would still show up on the manifest as their job
pre-demotion, this fixes that.
## Changelog
🆑
fix: The crew manifest now properly updates after ID modifications.
/🆑

* (Fix) The crew manifest now properly updates after ID modifications.

---------

Co-authored-by: Pinta <68373373+softcerv@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-04-07 01:11:00 +02:00
committed by GitHub
parent 041e35e0ac
commit 9b01e0528c
4 changed files with 22 additions and 12 deletions

View File

@@ -73,6 +73,20 @@
return FALSE
/datum/computer_file/program/card_mod/on_start(mob/living/user)
. = ..()
if(!.)
return FALSE
computer.crew_manifest_update = TRUE
/datum/computer_file/program/card_mod/kill_program(forced)
computer.crew_manifest_update = FALSE
var/obj/item/card/id/inserted_auth_card = computer.computer_id_slot
if(inserted_auth_card)
GLOB.manifest.modify(inserted_auth_card.registered_name, inserted_auth_card.assignment, inserted_auth_card.get_trim_assignment())
return ..()
/datum/computer_file/program/card_mod/ui_act(action, params)
. = ..()
if(.)
@@ -121,23 +135,13 @@
playsound(computer, 'sound/machines/terminal_on.ogg', 50, FALSE)
computer.visible_message(span_notice("\The [computer] prints out a paper."))
return TRUE
// Eject the ID used to log on to the ID app.
if("PRG_ejectauthid")
if("PRG_eject_id")
if(inserted_auth_card)
return computer.RemoveID(usr)
else
var/obj/item/I = user.get_active_held_item()
if(isidcard(I))
return computer.InsertID(I, user)
// Eject the ID being modified.
if("PRG_ejectmodid")
if(inserted_auth_card)
GLOB.manifest.modify(inserted_auth_card.registered_name, inserted_auth_card.assignment, inserted_auth_card.get_trim_assignment())
return computer.RemoveID(usr)
else
var/obj/item/I = user.get_active_held_item()
if(isidcard(I))
return computer.InsertID(I, user)
return TRUE
// Used to fire someone. Wipes all access from their card and modifies their assignment.
if("PRG_terminate")