More optimizations for character joins

This commit is contained in:
Arokha Sieyes
2018-02-17 21:39:26 -06:00
committed by Leshana
parent a6cfbc4f42
commit 0e2f41ea86
6 changed files with 16 additions and 15 deletions

View File

@@ -236,8 +236,4 @@
#define USE_FAIL_DEAD 4 #define USE_FAIL_DEAD 4
#define USE_FAIL_INCAPACITATED 5 #define USE_FAIL_INCAPACITATED 5
#define USE_FAIL_NOT_IN_USER 6 #define USE_FAIL_NOT_IN_USER 6
#define USE_FAIL_IS_SILICON 7 #define USE_FAIL_IS_SILICON 7
//Useful for building semicolon-delimited time readouts when trying to find slowdowns in procs
var/world_time_test = 0
#define TIMETEST ;world << "<b>TIME DBG</b>;[__FILE__];[__LINE__]; [round(world.tick_usage)]% ([round(world.tick_usage - world_time_test)]%)";world_time_test = world.tick_usage

View File

@@ -260,11 +260,13 @@
ResetPDAManifest() ResetPDAManifest()
var/icon/front var/icon/front
var/icon/side var/icon/side
var/icon/charicon = cached_character_icon(H) if(H)
front = icon(charicon, dir = SOUTH) var/icon/charicon = cached_character_icon(H)
side = icon(charicon, dir = WEST) front = icon(charicon, dir = SOUTH)
side = icon(charicon, dir = WEST)
if(!id) id = text("[]", add_zero(num2hex(rand(1, 65536)), 4)) if(!id)
id = text("[]", add_zero(num2hex(rand(1, 65536)), 4))
var/datum/data/record/G = new /datum/data/record() var/datum/data/record/G = new /datum/data/record()
G.name = "Employee Record #[id]" G.name = "Employee Record #[id]"
G.fields["name"] = "New Record" G.fields["name"] = "New Record"

View File

@@ -101,7 +101,6 @@ var/list/outfits_decls_by_type_
H.equip_to_slot_or_del(new path(H), slot_in_backpack) H.equip_to_slot_or_del(new path(H), slot_in_backpack)
post_equip(H) post_equip(H)
H.regenerate_icons()
if(W) // We set ID info last to ensure the ID photo is as correct as possible. if(W) // We set ID info last to ensure the ID photo is as correct as possible.
H.set_id_info(W) H.set_id_info(W)
return 1 return 1
@@ -158,15 +157,18 @@ var/list/outfits_decls_by_type_
W.rank = rank W.rank = rank
if(assignment) if(assignment)
W.assignment = assignment W.assignment = assignment
H.set_id_info(W)
if(H.equip_to_slot_or_del(W, id_slot)) if(H.equip_to_slot_or_del(W, id_slot))
return W return W
/decl/hierarchy/outfit/proc/equip_pda(mob/living/carbon/human/H, assignment) /decl/hierarchy/outfit/proc/equip_pda(mob/living/carbon/human/H, rank, assignment)
if(!pda_slot || !pda_type) if(!pda_slot || !pda_type)
return return
var/obj/item/device/pda/pda = new pda_type(H) var/obj/item/device/pda/pda = new pda_type(H)
if(H.equip_to_slot_or_del(pda, pda_slot)) if(H.equip_to_slot_or_del(pda, pda_slot))
pda.owner = H.real_name
pda.ownjob = assignment
pda.ownrank = rank
pda.name = "PDA-[H.real_name] ([assignment])"
return pda return pda
/decl/hierarchy/outfit/dd_SortValue() /decl/hierarchy/outfit/dd_SortValue()

View File

@@ -507,7 +507,8 @@ var/global/datum/controller/occupations/job_master
proc/spawnId(var/mob/living/carbon/human/H, rank, title) proc/spawnId(var/mob/living/carbon/human/H, rank, title)
if(!H) return 0 if(!H) return 0
var/obj/item/weapon/card/id/C = null var/obj/item/weapon/card/id/C = H.get_equipped_item(slot_wear_id)
if(istype(C)) return 0
var/datum/job/job = null var/datum/job/job = null
for(var/datum/job/J in occupations) for(var/datum/job/J in occupations)

View File

@@ -273,7 +273,7 @@ datum/preferences
ShowChoices(usr) ShowChoices(usr)
return 1 return 1
/datum/preferences/proc/copy_to(mob/living/carbon/human/character, icon_updates = 1) /datum/preferences/proc/copy_to(mob/living/carbon/human/character, icon_updates = TRUE)
// Sanitizing rather than saving as someone might still be editing when copy_to occurs. // Sanitizing rather than saving as someone might still be editing when copy_to occurs.
player_setup.sanitize_setup() player_setup.sanitize_setup()

View File

@@ -453,7 +453,7 @@
client.prefs.real_name = random_name(new_character.gender) client.prefs.real_name = random_name(new_character.gender)
client.prefs.randomize_appearance_and_body_for(new_character) client.prefs.randomize_appearance_and_body_for(new_character)
else else
client.prefs.copy_to(new_character) client.prefs.copy_to(new_character, icon_updates = TRUE)
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS cant last forever yo src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS cant last forever yo