From da664ddaa2181cb9ef56f19fdc134eda659572d0 Mon Sep 17 00:00:00 2001 From: Osmium Sorcerer Date: Mon, 16 Mar 2026 15:42:36 +0000 Subject: Fix offset token substitution in MS packet In an IC message, x and y offsets are separated by an ampersand, which is unfortunately a conventional separator within packet fields. So, it looks like `25&10` for x = 25 and y = 10. A consequence of that is you have to substitute '&' if you actually want to send it. AO does it by substituting it to `` and back. The MS handler instead expected it to never be decoded, and instead assumed `2510`. By the time the MS packet reaches the handler, the token has already been decoded into '&', however, thus breaking offsets. --- webAO/packets/handlers/handleMS.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webAO/packets/handlers/handleMS.ts b/webAO/packets/handlers/handleMS.ts index a2f7f33..746b84d 100644 --- a/webAO/packets/handlers/handleMS.ts +++ b/webAO/packets/handlers/handleMS.ts @@ -85,8 +85,8 @@ export const handleMS = (args: string[]) => { other_charid: Number(args[17]), other_name: safeTags(args[18]), other_emote: safeTags(args[19]), - self_offset: args[20].split(""), // HACK: here as well, client is fucked and uses this instead of & - other_offset: args[21].split(""), + self_offset: args[20].split("&"), + other_offset: args[21].split("&"), other_flip: Number(args[22]), noninterrupting_preanim: Number(args[23]), }; -- cgit