mirror of
https://github.com/Cesarus85/ringfall-mjolnir-vr.git
synced 2026-10-23 06:00:25 +02:00
Close throw_grenade_release exactly: units.obj reaches 183/6/0
Census 182/7/0 -> 183/6/0 code, data unchanged at 129/0/0. This closes the
object's most-worked residual, which had survived roughly 200 measured source
variants across five sessions.
The residual was two transpositions in one seven-instruction window: January
issues the FP op first in each FP/integer pair where we issued the push first.
The lever is the declared type of the scalar fed to the inlined
point_from_line3d expansion. Loading each grenade_origin component into a double
temp and narrowing with an explicit (real) cast at the call makes the dependent
x87 op issue one slot later, which drains the extra integer op into the multiply
shadow and reproduces January's pairing exactly.
The casts are load-bearing: without them the float constants promote to double
and fmul dword becomes fmul qword. Retyping all three components as separate
double temps, or as real temps, is much worse (43-44 blocks); a single reused
double temp is exact.
The mechanism came from a sibling investigation that found it on an 80-byte
miniature in hs.obj rather than on this function, then classified every
function in the build that differs only by a transposition. That scan named
this owner as a candidate.
Wave gates: /Zs exit 0 with no warnings; contained deletion with a dry run
proving exactly one CL edge; one emission; owner gate pinned to 6f18872a shows
exactly one changed owner of 220, the intended one; determinism replay identical
across all 220 owners.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6f18872a72
commit
a4ba37a969
1 file changed
+7
-3
@@ -11158,6 +11158,7 @@ static void unit_throw_grenade_release(
|
||||
real_vector3d left;
|
||||
real_vector3d up;
|
||||
real_point3d camera_position;
|
||||
double origin_scale;
|
||||
struct game_globals_player_information* player_information = TAG_BLOCK_GET_ELEMENT(
|
||||
&scenario_get_game_globals()->player_information,
|
||||
0,
|
||||
@@ -11173,9 +11174,12 @@ static void unit_throw_grenade_release(
|
||||
normalize3d(cross_product3d(&forward, &up, &left));
|
||||
|
||||
unit_get_camera_position(unit_index, &camera_position);
|
||||
point_from_line3d(&camera_position, &forward, player_information->grenade_origin.i, &camera_position);
|
||||
point_from_line3d(&camera_position, &up, player_information->grenade_origin.j, &camera_position);
|
||||
point_from_line3d(&camera_position, &left, player_information->grenade_origin.k, &camera_position);
|
||||
origin_scale = player_information->grenade_origin.i;
|
||||
point_from_line3d(&camera_position, &forward, (real)origin_scale, &camera_position);
|
||||
origin_scale = player_information->grenade_origin.j;
|
||||
point_from_line3d(&camera_position, &up, (real)origin_scale, &camera_position);
|
||||
origin_scale = player_information->grenade_origin.k;
|
||||
point_from_line3d(&camera_position, &left, (real)origin_scale, &camera_position);
|
||||
|
||||
object_translate(grenade_index, &camera_position, NULL);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user