
Notice how the leg hit box drops down over the edge, even though the model legs stick straight out. That isn’t the worst case either. Sometimes it is completely invisible :moo:
This caused by the value of pmext.proneLegsOffset calculated in bg_slidemove_prone.c:PM_SlideMoveProne
I haven’t figured out exactly where it goes wrong. The whole functions is rather… nice.
edit:
heres one issue:
org[2] = trace.endpos[2] + 24.f; // 24 units to play with
...snip...
} else {
// actually covered some distance
VectorCopy( trace.endpos, pm->ps->origin );
pm->pmext->proneLegsOffset = org[2];
}
org[2] is cannot be sensibly interpreted as an offset, since it is an absolute position in the world. So when proneLegsOffset is used to create the leg hitbox in g_combat.c:G_BuildLeg,
org[0] = ent->r.currentOrigin[0] + flatforward[0] * -32;
org[1] = ent->r.currentOrigin[1] + flatforward[1] * -32;
org[2] = ent->r.currentOrigin[2] + ent->client->pmext.proneLegsOffset;
it may end up in some position very far from the player.
edit #2:
some printf debugging:
aldbg b=(921.802551,-2553.137451,1048.125000) h=(920.19,-2526.18,1029.19) l=(923.71,-2585.02,2120.25)
b = body origin, h=head origin, l=leg origin. Notice that the leg origin Z is over 1000 units away from the body and head.
edit #3:
It also seems to me there are also a number of cases where proneLegsOffset wont get updated at all.