// Let Unit::loadCrew read the local player's equipped crew when the multiplayer host is LocalMP. // Why the exe: native initialization skips the profile on hosts before it builds the live crew object. // Without it: a human player's LocalMP unit receives default skills instead of the crew in the profile. { "id": "battle/load-local-host-player-crew", "title": "Load the equipped player's crew on a LocalMP host", "features": ["E-Crew skills in battle"], "requires": [], "variants": [ // Unit::loadCrew tests the host flag, then the unit's player bit and the local player ID. // The adjacent host and LocalMP fields are boolean bytes at +0x60 and +0x61 in Multiplayer. // Keep the owner checks and skip to the default crew only for a non-LocalMP host. // 2.61.0.37: site 0x10025d6, edit at 0x10025dd; 2.61.0.58: edit at 0x100700d. { "written_for": "2.61.0.37", "locate": { "method": "signature", "section": ".text", "pattern": "48 8b 05 ?? ?? ?? ?? 48 85 c0 74 0a 80 78 60 00 0f 85 ?? ?? ?? ?? 8b 86 90 00 00 00 a9 00 01 00 00 75 15 48 8b 05 ?? ?? ?? ?? 8b 80 a4 05 00 00 39 c5", "captures": { "default_crew": { "offset": 18, "type": "rel32" } } }, "edit": { "offset": 7, "asm": [ "test rax, rax", "je check_owner", "cmp word ptr [rax + 0x60], 1", "je {default_crew}", "check_owner:", "test byte ptr [rsi + 0x91], 1", "nop", "nop", "nop" ], "bytes": "48 85 c0 74 0b 66 83 78 60 01 0f 84 ?? ?? ?? ?? f6 86 91 00 00 00 01 90 90 90", "expect_original": "48 85 c0 74 0a 80 78 60 00 0f 85 ?? ?? ?? ?? 8b 86 90 00 00 00 a9 00 01 00 00", "fixups": [{ "at": 12, "type": "rel32", "target": "default_crew" }] } } ] }