From 9f6c57587bb1eb69fbc051f7d6dd6e1dc95ab8bf Mon Sep 17 00:00:00 2001 From: Eccentric Date: Sat, 20 Jan 2024 23:06:36 +0000 Subject: [PATCH] fix item wrap not equipable --- handlers/client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/handlers/client.go b/handlers/client.go index 320f6cb..0bc8dd1 100644 --- a/handlers/client.go +++ b/handlers/client.go @@ -168,7 +168,7 @@ func clientEquipBattleRoyaleCustomizationAction(c *fiber.Ctx, person *p.Person, } } - attr := profile.Attributes.GetAttributeByKey("favorite_" + strings.ToLower(body.SlotName)) + attr := profile.Attributes.GetAttributeByKey("favorite_" + strings.ReplaceAll(strings.ToLower(body.SlotName), "wrap", "wraps")) if attr == nil { return fmt.Errorf("attribute not found") } @@ -180,6 +180,10 @@ func clientEquipBattleRoyaleCustomizationAction(c *fiber.Ctx, person *p.Person, attr.ValueJSON = aid.JSONStringify(value) case "ItemWrap": value := aid.JSONParse(attr.ValueJSON) + if body.IndexWithinSlot == -1 { + attr.ValueJSON = aid.JSONStringify([]any{item.ID,item.ID,item.ID,item.ID,item.ID,item.ID,item.ID}) + break + } value.([]any)[body.IndexWithinSlot] = item.ID attr.ValueJSON = aid.JSONStringify(value) default: