mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
[FIX] Json serialization/deserialization for characters (#27454)
* Wrong branch again * Corrected comment * Requested changes * Updated comment * Update code/modules/mob/living/carbon/human/human_mob.dm Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com> --------- Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Co-authored-by: Adrer <adrermail@gmail.com> Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
This commit is contained in:
@@ -1782,9 +1782,9 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
|
||||
|
||||
// Equipment
|
||||
equip_list.len = ITEM_SLOT_AMOUNT
|
||||
for(var/i = 1, i < ITEM_SLOT_AMOUNT, i++)
|
||||
var/obj/item/thing = get_item_by_slot(i)
|
||||
if(thing != null)
|
||||
for(var/i in 1 to ITEM_SLOT_AMOUNT)
|
||||
var/obj/item/thing = get_item_by_slot(1<<(i - 1)) // -1 because ITEM_SLOT_FLAGS start at 0 (and BYOND lists do not)
|
||||
if(!isnull(thing))
|
||||
equip_list[i] = thing.serialize()
|
||||
|
||||
for(var/obj/item/bio_chip/implant in src)
|
||||
@@ -1841,20 +1841,20 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
|
||||
// #1: Jumpsuit
|
||||
// #2: Outer suit
|
||||
// #3+: Everything else
|
||||
if(islist(equip_list[ITEM_SLOT_JUMPSUIT]))
|
||||
var/obj/item/clothing/C = list_to_object(equip_list[ITEM_SLOT_JUMPSUIT], T)
|
||||
if(islist(equip_list[ITEM_SLOT_2_INDEX(ITEM_SLOT_JUMPSUIT)]))
|
||||
var/obj/item/clothing/C = list_to_object(equip_list[ITEM_SLOT_2_INDEX(ITEM_SLOT_JUMPSUIT)], T)
|
||||
equip_to_slot_if_possible(C, ITEM_SLOT_JUMPSUIT)
|
||||
|
||||
if(islist(equip_list[ITEM_SLOT_OUTER_SUIT]))
|
||||
var/obj/item/clothing/C = list_to_object(equip_list[ITEM_SLOT_OUTER_SUIT], T)
|
||||
if(islist(equip_list[ITEM_SLOT_2_INDEX(ITEM_SLOT_OUTER_SUIT)]))
|
||||
var/obj/item/clothing/C = list_to_object(equip_list[ITEM_SLOT_2_INDEX(ITEM_SLOT_OUTER_SUIT)], T)
|
||||
equip_to_slot_if_possible(C, ITEM_SLOT_OUTER_SUIT)
|
||||
|
||||
for(var/i = 1, i < ITEM_SLOT_AMOUNT, i++)
|
||||
if(i == ITEM_SLOT_JUMPSUIT || i == ITEM_SLOT_OUTER_SUIT)
|
||||
for(var/i in 1 to (ITEM_SLOT_AMOUNT))
|
||||
if(i == ITEM_SLOT_2_INDEX(ITEM_SLOT_JUMPSUIT) || i == ITEM_SLOT_2_INDEX(ITEM_SLOT_OUTER_SUIT))
|
||||
continue
|
||||
if(islist(equip_list[i]))
|
||||
var/obj/item/clothing/C = list_to_object(equip_list[i], T)
|
||||
equip_to_slot_if_possible(C, i)
|
||||
equip_to_slot_if_possible(C, 1<<(i - 1)) // -1 because ITEM_SLOT_FLAGS start at 0 (and BYOND lists do not)
|
||||
update_icons()
|
||||
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user