Files
source/Tactical
17d0c9f672 read the gear template item into the node, not into a temporary
LoadEquipmentTemplate parsed each line of a saved equipment template like
this:

    if ( iss >> num && iss >> (UINT16)node.item )

node.item is already a UINT16, so the cast does nothing except turn the member
into a temporary. The stream then extracts into that temporary, which is
thrown away at the semicolon, and node.item keeps the 0 its constructor gave
it. node.ammoitem, cast the same way on the next line, is lost with it.

This is not only a parse error. The tokens are still consumed, so the line
parses and the node is appended, but every node comes back with item 0. The
consumer skips those:

    if ( node.slot >= 0 && node.slot < NUM_INV_SLOTS && node.item != NOTHING )

so loading an equipment template has been quietly doing nothing at all. Only
the attachments, read through a real variable, ever survived, and they were
attached to a node that got skipped.

Removing the two casts makes the extraction write where it was always meant
to. slot is still read through num, as it must be, since it is an INT8 and the
stream would take it for a character.

This changes behaviour: gear templates will start applying. That is the point,
but it is worth knowing before this ships.

Verification:

    ninja -C build parse         # both Handle Items.cpp sites gone
    ninja -C build -k 0          # Release, four applications, green
    ninja -C build-debug -k 0    # Debug, four applications, green

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 19:29:55 -03:00
..
2025-12-09 00:35:18 +02:00
2025-11-19 21:11:19 +02:00
2025-12-09 00:35:18 +02:00
2026-01-03 17:27:43 +02:00
2025-12-09 00:35:18 +02:00
2025-06-22 12:43:33 +03:00
2025-12-09 00:35:18 +02:00
2026-02-21 21:00:38 +02:00
2026-01-03 17:27:43 +02:00
2025-12-09 00:35:18 +02:00
2025-09-24 16:14:10 +03:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2024-11-18 01:01:57 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2025-11-23 18:28:17 +02:00
2026-06-12 15:52:24 +03:00
2025-08-08 18:00:31 +03:00
2025-08-08 18:00:31 +03:00
2025-12-09 00:35:18 +02:00
2026-06-12 15:52:24 +03:00
2025-12-09 00:35:18 +02:00
2024-11-17 23:45:48 +02:00
2026-01-03 17:27:43 +02:00
2024-11-17 23:45:48 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2026-06-01 21:45:55 -03:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2024-11-17 19:41:34 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2025-08-08 16:39:52 +03:00
2025-08-08 18:00:31 +03:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2024-11-17 22:29:31 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2025-12-09 00:35:18 +02:00
2023-01-03 15:51:48 +02:00
2023-01-03 15:51:48 +02:00