Skip to content

Commit

Permalink
horse
Browse files Browse the repository at this point in the history
  • Loading branch information
00-Steven committed Nov 13, 2024
1 parent 6b212ba commit 7392596
Showing 1 changed file with 17 additions and 1 deletion.
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

0 comments on commit 7392596

Please sign in to comment.