try this again

This commit is contained in:
DragonTrance
2021-03-08 15:20:23 -07:00
parent a2a11ce30b
commit 49bbcefba8
7 changed files with 53 additions and 53 deletions
+1 -4
View File
@@ -390,6 +390,7 @@ SUBSYSTEM_DEF(job)
var/datum/job/job = GetJob(rank)
H.job = rank
equip_loadout(N, H)
//If we joined at roundstart we should be positioned at our workstation
if(!joined_late)
@@ -416,8 +417,6 @@ SUBSYSTEM_DEF(job)
H.mind.assigned_role = rank
if(job)
if(!job.dresscodecompliant)// CIT CHANGE - dress code compliance
equip_loadout(N, H) // CIT CHANGE - allows players to spawn with loadout items
var/new_mob = job.equip(H, null, null, joined_late)
if(ismob(new_mob))
H = new_mob
@@ -449,8 +448,6 @@ SUBSYSTEM_DEF(job)
H.add_memory("Your account ID is [wageslave.account_id].")
if(job && H)
if(job.dresscodecompliant)// CIT CHANGE - dress code compliance
equip_loadout(N, H) // CIT CHANGE - allows players to spawn with loadout items
job.after_spawn(H, M, joined_late) // note: this happens before the mob has a key! M will always have a client, H might not.
equip_loadout(N, H, TRUE)//CIT CHANGE - makes players spawn with in-backpack loadout items properly. A little hacky but it works
+25 -25
View File
@@ -40,31 +40,44 @@
//Start with uniform,suit,backpack for additional slots
if(uniform)
H.equip_to_slot_or_del(new uniform(H),SLOT_W_UNIFORM)
H.equip_to_slot_or_store_and_del(new uniform(H),SLOT_W_UNIFORM)
if(suit)
H.equip_to_slot_or_del(new suit(H),SLOT_WEAR_SUIT)
H.equip_to_slot_or_store_and_del(new suit(H),SLOT_WEAR_SUIT)
if(back)
H.equip_to_slot_or_del(new back(H),SLOT_BACK)
if(!visualsOnly) // Items in pockets or backpack don't show up on mob's icon.
if(l_pocket)
H.equip_to_slot_or_store_and_del(new l_pocket(H),SLOT_L_STORE)
if(r_pocket)
H.equip_to_slot_or_store_and_del(new r_pocket(H),SLOT_R_STORE)
if(backpack_contents)
for(var/path in backpack_contents)
var/number = backpack_contents[path]
if(!isnum(number))//Default to 1
number = 1
for(var/i in 1 to number)
H.equip_to_slot_or_del(new path(H),SLOT_IN_BACKPACK)
if(belt)
H.equip_to_slot_or_del(new belt(H),SLOT_BELT)
H.equip_to_slot_or_store_and_del(new belt(H),SLOT_BELT)
if(gloves)
H.equip_to_slot_or_del(new gloves(H),SLOT_GLOVES)
H.equip_to_slot_or_store_and_del(new gloves(H),SLOT_GLOVES)
if(shoes)
H.equip_to_slot_or_del(new shoes(H),SLOT_SHOES)
H.equip_to_slot_or_store_and_del(new shoes(H),SLOT_SHOES)
if(head)
H.equip_to_slot_or_del(new head(H),SLOT_HEAD)
H.equip_to_slot_or_store_and_del(new head(H),SLOT_HEAD)
if(mask)
H.equip_to_slot_or_del(new mask(H),SLOT_WEAR_MASK)
H.equip_to_slot_or_store_and_del(new mask(H),SLOT_WEAR_MASK)
if(neck)
H.equip_to_slot_or_del(new neck(H),SLOT_NECK)
H.equip_to_slot_or_store_and_del(new neck(H),SLOT_NECK)
if(ears)
H.equip_to_slot_or_del(new ears(H),SLOT_EARS)
H.equip_to_slot_or_store_and_del(new ears(H),SLOT_EARS)
if(glasses)
H.equip_to_slot_or_del(new glasses(H),SLOT_GLASSES)
H.equip_to_slot_or_store_and_del(new glasses(H),SLOT_GLASSES)
if(id)
H.equip_to_slot_or_del(new id(H),SLOT_WEAR_ID)
H.equip_to_slot_or_store_and_del(new id(H),SLOT_WEAR_ID)
if(suit_store)
H.equip_to_slot_or_del(new suit_store(H),SLOT_S_STORE)
H.equip_to_slot_or_store_and_del(new suit_store(H),SLOT_S_STORE)
if(accessory)
var/obj/item/clothing/under/U = H.w_uniform
@@ -78,19 +91,6 @@
if(r_hand)
H.put_in_r_hand(new r_hand(H))
if(!visualsOnly) // Items in pockets or backpack don't show up on mob's icon.
if(l_pocket)
H.equip_to_slot_or_del(new l_pocket(H),SLOT_L_STORE)
if(r_pocket)
H.equip_to_slot_or_del(new r_pocket(H),SLOT_R_STORE)
if(backpack_contents)
for(var/path in backpack_contents)
var/number = backpack_contents[path]
if(!isnum(number))//Default to 1
number = 1
for(var/i in 1 to number)
H.equip_to_slot_or_del(new path(H),SLOT_IN_BACKPACK)
if(!H.head && toggle_helmet && istype(H.wear_suit, /obj/item/clothing/suit/space/hardsuit))
var/obj/item/clothing/suit/space/hardsuit/HS = H.wear_suit
HS.ToggleHelmet()
+1 -1
View File
@@ -224,7 +224,7 @@
if(!J)
J = SSjob.GetJob(H.job)
if(H.nameless && J.dresscodecompliant)
if(H.nameless)
if(J.title in GLOB.command_positions)
H.real_name = J.title
else
+14 -4
View File
@@ -235,15 +235,19 @@ mob/visible_message(message, self_message, blind_message, vision_distance = DEFA
//set qdel_on_fail to have it delete W if it fails to equip
//set disable_warning to disable the 'you are unable to equip that' warning.
//unset redraw_mob to prevent the mob from being redrawn at the end.
/mob/proc/equip_to_slot_if_possible(obj/item/W, slot, qdel_on_fail = FALSE, disable_warning = FALSE, redraw_mob = TRUE, bypass_equip_delay_self = FALSE)
/mob/proc/equip_to_slot_if_possible(obj/item/W, slot, qdel_on_fail = FALSE, disable_warning = FALSE, redraw_mob = TRUE, bypass_equip_delay_self = FALSE, store = FALSE)
if(!istype(W))
return FALSE
if(!W.mob_can_equip(src, null, slot, disable_warning, bypass_equip_delay_self))
if(store && istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
var/obj/item/storage/backpack/BP = H.back
if(BP)
return SEND_SIGNAL(BP, COMSIG_TRY_STORAGE_INSERT, W, null, TRUE, TRUE)
if(qdel_on_fail)
qdel(W)
else
if(!disable_warning)
to_chat(src, "<span class='warning'>You are unable to equip that!</span>")
else if(!disable_warning)
to_chat(src, "<span class='warning'>You are unable to equip that!</span>")
return FALSE
equip_to_slot(W, slot, redraw_mob) //This proc should not ever fail.
return TRUE
@@ -258,6 +262,12 @@ mob/visible_message(message, self_message, blind_message, vision_distance = DEFA
/mob/proc/equip_to_slot_or_del(obj/item/W, slot)
return equip_to_slot_if_possible(W, slot, TRUE, TRUE, FALSE, TRUE)
/mob/proc/equip_to_slot_or_store(obj/item/W, slot)
return equip_to_slot_if_possible(W, slot, FALSE, TRUE, FALSE, TRUE, TRUE)
/mob/proc/equip_to_slot_or_store_and_del(obj/item/W, slot)
return equip_to_slot_if_possible(W, slot, TRUE, TRUE, FALSE, TRUE, TRUE)
//puts the item "W" into an appropriate slot in a human's inventory
//returns 0 if it cannot, 1 if successful
/mob/proc/equip_to_appropriate_slot(obj/item/W)