mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-06-13 22:16:10 -04:00
eb4142835e
The resolved replacement id (which can exceed 255) rode a single per-player seqToPlay slot, written at enqueue but consumed asynchronously on the audio thread; back-to-back starts and priority-queue promotions clobbered it. sSeqFlags[0x6F] was also indexed by raw id, reading out of bounds past the authentic range. - func_800F9280 resolves the replacement and packs the full 16-bit id into the 0x82/0x85 play command; the handler reads opArgs & 0xFFFF. Audio_QueueSeqCmd no longer pre-writes the shared slot. - SyncInitSeqPlayerInternal uses the command-carried id and bounds-checks it against the calloc'd sequence map (+0xF headroom for reserved-range skips). - Route sSeqFlags reads through a bounded Audio_GetSeqFlags helper. - Warn and skip gracefully past the 16-bit id limit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>