[Issue Report]: [1.6] Wrong placement of dialog options

Author: DeveloperGuillimanCreated Sep 18, 2026Updated Sep 18, 2026

Operating System

Windows x64

DevilutionX version

Custom build (please specify commit ID)

Describe

DevilutionX version 1.6.0 (0ff3186) Testing LUA capabilities of the towners interface, when adding options to a towner, the first option added is positioned in the space between the title and the first original option, like in the following image: Image The rest of the new options are placed at the end, as expected.

To Reproduce

Load a mod with the following init.lua:

local log = require("devilutionx.log")
local towners = require("devilutionx.towners")

function farnhamOptionALabel()
  log.info("function farnhamOptionALabel()")
  return "Option A"
end

function farnhamOptionASelect()
  log.info("function farnhamOptionASelect()")
end

function farnhamOptionBLabel()
  log.info("function farnhamOptionBLabel()")
  return "Option B"
end

function farnhamOptionBSelect()
  log.info("function farnhamOptionBSelect()")
end

function farnhamOptionCLabel()
  log.info("function farnhamOptionCLabel()")
  return "Option C"
end

function farnhamOptionCSelect()
  log.info("function farnhamOptionCSelect()")
end

towners.addDialogOption("farnham" , farnhamOptionALabel, farnhamOptionASelect)
towners.addDialogOption("farnham" , farnhamOptionBLabel, farnhamOptionBSelect)
towners.addDialogOption("farnham" , farnhamOptionCLabel, farnhamOptionCSelect)

To see the new options, start a new game and talk to Farnham

Expected Behavior

No response

Additional context

No response