Skip to content

Commit

Permalink
Fix Renaming Captain's Spare ID Not Updating Text, Remove Extra Typin…
Browse files Browse the repository at this point in the history
…g Sounds (#384)
  • Loading branch information
RimiNosha authored Nov 20, 2023
1 parent 5f731a9 commit 3dfa1a3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions code/modules/modular_computers/file_system/programs/card.dm
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@

if(!new_name)
inserted_auth_card.registered_name = null
playsound(computer, SFX_TERMINAL_TYPE, 50, FALSE)
inserted_auth_card.update_label()
// We had a name before and now we have no name, so this will unassign the card and we update the icon.
if(old_name)
Expand All @@ -187,10 +186,9 @@
return TRUE

inserted_auth_card.registered_name = new_name
playsound(computer, SFX_TERMINAL_TYPE, 50, FALSE)
inserted_auth_card.update_label()
// Card wasn't assigned before and now it is, so update the icon accordingly.
if(!old_name)
if(!old_name || old_name == "Captain")
inserted_auth_card.update_icon()
return TRUE
// Change age
Expand All @@ -204,22 +202,19 @@
return TRUE

inserted_auth_card.registered_age = new_age
playsound(computer, SFX_TERMINAL_TYPE, 50, FALSE)
return TRUE
// Change assignment
if("PRG_assign")
if(!computer || !authenticated_card || !inserted_auth_card)
return TRUE
var/new_asignment = sanitize(params["assignment"])
inserted_auth_card.assignment = new_asignment
playsound(computer, SFX_TERMINAL_TYPE, 50, FALSE)
inserted_auth_card.update_label()
return TRUE
// Add/remove access.
if("PRG_access")
if(!computer || !authenticated_card || !inserted_auth_card)
return TRUE
playsound(computer, SFX_TERMINAL_TYPE, 50, FALSE)
var/access_type = params["access_target"]
var/try_wildcard = params["access_wildcard"]
if(!(access_type in valid_access))
Expand All @@ -245,7 +240,6 @@
if(!computer || !authenticated_card || !inserted_auth_card)
return TRUE

playsound(computer, SFX_TERMINAL_TYPE, 50, FALSE)
var/template_name = params["name"]

if(!template_name)
Expand Down

0 comments on commit 3dfa1a3

Please sign in to comment.