mirror of
https://github.com/Cesarus85/ringfall-mjolnir-vr.git
synced 2026-10-25 21:00:28 +01:00
Route the three animation_choose_random_permutation_internal call sites through a long animation_graph_index local, matching the byte-exact unit_start_animation_impulse idiom at units.c:8535 and units.c:3245. unit_animation_set_state was the file's only site that inlined the field expression into the call. That flips one allocator decision: January spends EDI on the unit_seat pointer (mov edi,eax / lea eax,[edi+0x58] / mov [ebp-0x1c],edi, then direct mov ecx,[edi+0x40] and [edi+0x44] later) and homes animation_index at [ebp-0xc); we did the reverse and reloaded the pointer at every use. The frame going 0x18 -> 0x1c and all three or edx,0ffffffffh sites were consequences, not separate differences. units.obj code census 186/3/0 -> 187/2/0; data unchanged at 129/0/0. Also reproduce January's setcc spelling in unit_update_animation: split the shared alert/suspicious case arm and write the in_combat arm with no byte-typed intermediate. setcc r8 ; movzx r16,r8 occurs zero times in all 9352 January functions; the new shape emits January's xor ebx,ebx / test cl,cl / setne bl / add ebx,2 and matches January's relocation layout exactly (relocation_infos_equal was False, now True). Still non-exact: 23 bytes, all register choices. CL /Zs /W3 unchanged at 43 diagnostics with identical codes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>