Skip to content

fix: use mjai_to_tid instead of parse_tile_136 for mjai tile parsing#88

Merged
smly merged 1 commit intomainfrom
fix/mjai-tile-parsing-in-apply-mjai-event
Feb 8, 2026
Merged

fix: use mjai_to_tid instead of parse_tile_136 for mjai tile parsing#88
smly merged 1 commit intomainfrom
fix/mjai-tile-parsing-in-apply-mjai-event

Conversation

@smly
Copy link
Owner

@smly smly commented Feb 8, 2026

Summary

  • Fix apply_mjai_event and MjaiReplay::from_jsonl to use mjai_to_tid instead of parse_tile_136 for parsing mjai-format tile strings
  • parse_tile_136 only handles mpsz format (1z, 0m, etc.), so mjai-specific tiles (E, S, W, N, P, F, C, 5mr, 5pr, 5sr) were silently mapped to tile ID 0 (1m)
  • The existing mjai_to_tid function in parser.rs (previously #[allow(dead_code)]) correctly handles both formats
  • Add test_apply_mjai_event_honor_and_red_tiles covering:
    • All 7 honor tiles (E/S/W/N/P/F/C)
    • Red fives (5pr, 5sr)
    • Dora marker with mjai honor string
    • Tsumo/Dahai/Dora events with mjai-format tiles

Closes #85

@smly smly added this to the v0.3.0 milestone Feb 8, 2026
@smly smly self-assigned this Feb 8, 2026
@smly smly added the bug Something isn't working label Feb 8, 2026
@smly smly merged commit b544784 into main Feb 8, 2026
4 checks passed
@smly smly deleted the fix/mjai-tile-parsing-in-apply-mjai-event branch February 8, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

apply_mjai_event parses mjai tiles in mpsz format

1 participant