Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions changelog/entries/2026-11-24_iselia_villager_dialogue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
issues: []
prs: []
no-links: true

---

# Fixed
Closing the villager’s conversation in Iselia now returns control to the player. Reimport the game assets to apply the fix to an existing installation.
24 changes: 24 additions & 0 deletions crates/importer/src/field_gameplay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub(crate) fn prepare(id: usize, bytes: &[u8]) -> Result<Cow<'_, [u8]>> {
}
Some(FieldId::AltessasHouse0139) => depart_after_blackout,
Some(FieldId::Iselia0341) => release_banishment_villagers,
Some(FieldId::Iselia0346) => finish_villager_dialogue,
Some(FieldId::Izoold0354) => |bytes| {
raise_boat_passengers(
bytes,
Expand Down Expand Up @@ -122,6 +123,29 @@ fn release_banishment_villagers(bytes: &[u8]) -> Result<Vec<u8>> {
Ok(corrected)
}

/// Both dialogue branches return through this jump. Skip the unused negation
/// of an empty stack and let the villager return control to the player.
fn finish_villager_dialogue(bytes: &[u8]) -> Result<Vec<u8>> {
const EXIT_JUMP: usize = 0x38c5 * 2;
const NEGATE_PC: u16 = 0x392e;
let header = header(bytes)?;
let mut corrected = bytes.to_vec();
let code = &mut corrected[header.code_base()..header.auxiliary_offset()];
expect_words(code, EXIT_JUMP, &[0x2001, NEGATE_PC])?;
expect_words(
code,
usize::from(NEGATE_PC) * 2,
&[
0x3005,
0x3000,
0x2000 | symphonia_script::NativeCall::EnableMappedInput as u16,
0x20ff,
],
)?;
code[EXIT_JUMP + 2..EXIT_JUMP + 4].copy_from_slice(&(NEGATE_PC + 2).to_be_bytes());
Ok(corrected)
}

/// Lift passengers three units so their feet and contact shadows clear the
/// sailboat's deck during departure and arrival.
fn raise_boat_passengers(bytes: &[u8], offsets: &[usize]) -> Result<Vec<u8>> {
Expand Down
Loading