diff options
| author | Osmium Sorcerer <os@sof.beauty> | 2026-03-16 15:42:36 +0000 |
|---|---|---|
| committer | Osmium Sorcerer <os@sof.beauty> | 2026-04-18 16:52:22 +0000 |
| commit | da664ddaa2181cb9ef56f19fdc134eda659572d0 (patch) | |
| tree | 5b39c93470bffe9c158f1461d88f01528325ee1e | |
| parent | c291a9b769d48aab72f5c133dd71e554a09b5d1a (diff) | |
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>` and back.
The MS handler instead expected it to never be decoded, and instead
assumed `25<and>10`. By the time the MS packet reaches the handler, the
token has already been decoded into '&', however, thus breaking offsets.
| -rw-r--r-- | webAO/packets/handlers/handleMS.ts | 4 |
1 files 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("<and>"), // HACK: here as well, client is fucked and uses this instead of & - other_offset: args[21].split("<and>"), + self_offset: args[20].split("&"), + other_offset: args[21].split("&"), other_flip: Number(args[22]), noninterrupting_preanim: Number(args[23]), }; |
