View Issue Details

IDProjectCategoryView StatusLast Update
0013512Dwarf FortressLegends Mode -- Generalpublic2026-05-27 22:52
Reporterdonottellmetonottellyou Assigned To 
PriorityhighSeveritymajorReproducibilityhave not tried
Status newResolutionopen 
Product Version53.14 
Summary0013512: Legends Mode XML export is malformed with some of the newer events added, prevents use of export
DescriptionExample bad xml in xxx-legends.xml (notice the missing > after </topic):

```
    <historical_event>
        <id>102115</id>
        <year>119</year>
        <seconds72>126883</seconds72>
        <type>peace rejected</type>
        <site_id>-1</site_id>
        <failed/>
        <result_magnitude>-1</result_magnitude>
        <topic>peace treaty</topic
        <topic>unconditional surrender</topic
        <topic>alliance</topic
        <topic>make contact</topic
        <topic>improve trade</topic
        <initiator_hfid>3357</initiator_hfid>
        <initiator_entity_id>289</initiator_entity_id>
        <target_hfid>11364</target_hfid>
        <target_entity_id>295</target_entity_id>
        <target_ep_id>-1</target_ep_id>
        <target_ep_entity_id>654</target_ep_entity_id>
    </historical_event>
```

This completely breaks the export for anyone who triggers the bug, forcing users to manually edit the xml to fix it.
Steps To Reproduce- Create world
- Create a fortress
- Engage in activities that trigger recording of the new event topics such as the following:
    - peace treaty
    - unconditional surrender
    - alliance
    - make contact
    - improve trade
such as a historical event of the type "peace rejected"
Additional InformationIn addition, my editor complains about invalid XML unicode character 0x11, but this might be a separate issue

This was discovered because it breaks Legendsviewer-Next https://github.com/Kromtec/LegendsViewer-Next/issues/65

This needs to be reproduced
Tagsdiplomacy, diplomat, event, leg, legends mode

Activities

donottellmetonottellyou

2026-05-27 12:27

reporter   ~0043233

To be clear, the last step would be to export the legends and find the bad code by searching for it in the xml

Quietust

2026-05-27 18:19

reporter   ~0043234

Last edited: 2026-05-27 18:20

There are actually 2 different bugs here, both in the same function (history_support_eventst::xml_dump):

1. The code for exporting negotiation result topic data is missing the ">" characters at the end of the tags
2. The switch (negotiation_result->topic) block is missing break; statements between each case, so "peace treaty" prints all 5, "unconditional surrender" prints 4, etc., and only "improve trade" prints by itself.

Quietust

2026-05-27 18:27

reporter   ~0043235

The error about "invalid XML unicode character 0x11" might be a problem with your XML editor not obeying (or understanding) the "charset='CP437'" at the very top of the document.

donottellmetonottellyou

2026-05-27 22:52

reporter   ~0043236

My editor just doesn't support that old encoding. I made an issue here but I guess we'll have to see if they fix it:
https://github.com/helix-editor/helix/issues/15804

Yeah I thought that was weird with the topics, but as you said it was a different issue so I didn't pay attention to it.

Add Note

Note

Issue History

Date Modified Username Field Change
2026-05-27 12:13 donottellmetonottellyou New Issue
2026-05-27 12:13 donottellmetonottellyou Tag Attached: diplomacy
2026-05-27 12:13 donottellmetonottellyou Tag Attached: diplomat
2026-05-27 12:13 donottellmetonottellyou Tag Attached: event
2026-05-27 12:13 donottellmetonottellyou Tag Attached: leg
2026-05-27 12:13 donottellmetonottellyou Tag Attached: legends mode
2026-05-27 12:27 donottellmetonottellyou Note Added: 0043233
2026-05-27 18:19 Quietust Note Added: 0043234
2026-05-27 18:20 Quietust Note Edited: 0043234
2026-05-27 18:27 Quietust Note Added: 0043235
2026-05-27 22:52 donottellmetonottellyou Note Added: 0043236