Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TM ONLY] Early mirror of bitrunning manifest changing fix (87879) #228

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion code/modules/bitrunning/components/avatar_connection.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@
var/alias = our_client?.prefs?.read_preference(/datum/preference/name/hacker_alias) || pick(GLOB.hacker_aliases)

if(alias && avatar.real_name != alias)
avatar.fully_replace_character_name(avatar.real_name, alias)
avatar.fully_replace_character_name(newname = alias)

update_avatar_id()

for(var/skill_type in old_mind.known_skills)
avatar.mind.set_experience(skill_type, old_mind.get_skill_exp(skill_type), silent = TRUE)
Expand Down Expand Up @@ -111,6 +113,20 @@
))


/// Updates our avatar's ID to match our avatar's name.
/datum/component/avatar_connection/proc/update_avatar_id()
var/mob/living/avatar = parent
var/obj/item/card/id/our_id = locate() in avatar.get_all_contents()
if(isnull(our_id))
return

our_id.registered_name = avatar.real_name
our_id.update_label()
our_id.update_icon()
if(our_id.registered_account)
our_id.registered_account.account_holder = avatar.real_name


/// Disconnects the avatar and returns the mind to the old_body.
/datum/component/avatar_connection/proc/full_avatar_disconnect(cause_damage = FALSE, datum/source)
#ifndef UNIT_TESTS
Expand Down
Loading