# Click-to-memorize + weapon Ratio fix (staged 2026-09-29, Trevor test only)

dinput8.dll md5 42386ff30c7821885fc05417cc30778b, built from client_dll/hjclient.c (backup of previous source: hjclient.c.bak-clickmem).
All previous hooks/patches unchanged except the weapon Ratio line, which is back ON (see below); one new hook SpellBookClick 0x75E790. verify_sites: 23/23 hook sites (22 existing + SpellBookClick) + 6 byte patches, 0 problems.

Behaviour: plain left-click on a scribed spell in the spell book = memorize it into the first empty usable gem
(same client call as dropping it on the gem: StartSpellMemorization 0x75BF30). No empty gem -> chat line, nothing else.
Stock behaviour (spell goes onto the cursor) for Shift/Ctrl+click, anything already on the cursor, empty book slot,
or /clickmem off. Replacing an OCCUPIED gem from the book now needs Shift+click (pick up) then click the gem.
While a memorization is running: chat line "You are already memorizing a spell.". Alt+click / right-click unchanged.

Kill switch: /clickmem off | /clickmem on | /clickmem (toggle). Session only (resets to ON at each game start).
Log: hjclient.log "clickmem: spell N book slot S -> gem G (started|refused)" (gem 1-based).

Promote: cp dinput8.dll ../patch_files/dinput8.dll && cd .. && python3 generate_manifest.py;
then remove the dinput8.dll line from Trevor's patcher_ignore.txt.

## Weapon Ratio line (re-enabled)
Item display window shows "Ratio: x.xxx (dmg / delay)" in cyan for weapons with damage and delay (not arrows).
Crash cause found: CStmlWnd::AppendSTML 0x886720 returns an 8-byte CXSize through a hidden pointer, not a CXStr.
We had given it a 4-byte CXStr as the return buffer, so it overwrote our stack (and freeing it crashed too).
Fixed to the real signature thiscall(stml, CXSize *ret, CXStr by value), ret 8, the callee releasing the text,
matching THJ's own call (their dinput8 at 100246EE) and the exe's callers 0x6556F8 / 0x74FECB / 0x7501CF.
Kill switch: /ratio off | /ratio on | /ratio (toggle). Session only (ON at each game start).

## Weapon Ratio line (re-enabled)
Item display window shows "Ratio: x.xxx (dmg / delay)" in cyan for weapons with damage and delay (not arrows).
Crash cause found: CStmlWnd::AppendSTML 0x886720 returns an 8-byte CXSize through a hidden pointer, not a CXStr.
We had given it a 4-byte CXStr as the return buffer, so it overwrote our stack (and freeing it crashed too).
Fixed to the real signature thiscall(stml, CXSize *ret, CXStr by value), ret 8, the callee releasing the text,
matching THJ's own call (their dinput8 at 100246EE) and the exe's callers 0x6556F8 / 0x74FECB / 0x7501CF.
Kill switch: /ratio off | /ratio on | /ratio (toggle). Session only (ON at each game start).
