mirror of
https://github.com/Ragora/T2-CPP.git
synced 2026-07-15 22:04:32 +00:00
Attempt to consider player input when moving with mech code
This commit is contained in:
parent
c64b0739f9
commit
752155db59
1 changed files with 13 additions and 15 deletions
|
|
@ -58,11 +58,6 @@ __declspec(naked) void updateMoveHook()
|
||||||
|
|
||||||
if (dAtob((playervar->CallMethod("isMechControlEnabled",0))) && mechchangedmove.freelook && (mechchangedmove.y>0.0))
|
if (dAtob((playervar->CallMethod("isMechControlEnabled",0))) && mechchangedmove.freelook && (mechchangedmove.y>0.0))
|
||||||
{
|
{
|
||||||
mechchangedmove.pitch = 0;
|
|
||||||
mechchangedmove.yaw = 0;
|
|
||||||
mechchangedmove.roll = 0;
|
|
||||||
mechchangedmove.freelook = true;
|
|
||||||
|
|
||||||
// FIXME: The 3 here should reference the datablock's maximum turning angle -- we're essentially normalizing our rotation here.
|
// FIXME: The 3 here should reference the datablock's maximum turning angle -- we're essentially normalizing our rotation here.
|
||||||
float turnStrength = playervar->headRotationZ / 3;
|
float turnStrength = playervar->headRotationZ / 3;
|
||||||
// Use whatever is leftover in our forward movement
|
// Use whatever is leftover in our forward movement
|
||||||
|
|
@ -72,14 +67,18 @@ __declspec(naked) void updateMoveHook()
|
||||||
float newHeadTurn = turnStrength * (MECH_TURNING_SPEED/20);
|
float newHeadTurn = turnStrength * (MECH_TURNING_SPEED/20);
|
||||||
|
|
||||||
mechchangedmove.y = forwardStrength;
|
mechchangedmove.y = forwardStrength;
|
||||||
mechchangedmove.x = turnStrength;
|
mechchangedmove.x += turnStrength;
|
||||||
// FIXME: Is the yaw value definitely in radians?
|
// FIXME: Is the yaw value definitely in radians?
|
||||||
playervar->mRotZ += newTurn;
|
playervar->mRotZ += newTurn + mechchangedmove.yaw;
|
||||||
|
|
||||||
// Now, we must translate the turning strength into an appropriate subtraction for our
|
// Now, we must translate the turning strength into an appropriate subtraction for our
|
||||||
// head rotation.
|
// head rotation.
|
||||||
playervar->headRotationZ += -newTurn;
|
playervar->headRotationZ += -newTurn;
|
||||||
|
|
||||||
|
mechchangedmove.pitch = 0;
|
||||||
|
mechchangedmove.yaw = 0;
|
||||||
|
mechchangedmove.roll = 0;
|
||||||
|
mechchangedmove.freelook = true;
|
||||||
}
|
}
|
||||||
__asm {
|
__asm {
|
||||||
mov eax,offset mechchangedmove
|
mov eax,offset mechchangedmove
|
||||||
|
|
@ -284,4 +283,3 @@ __declspec(naked) void updateMoveHook()
|
||||||
DX::memPatch(0x5D2D6E,(unsigned char *)mechcode,7);
|
DX::memPatch(0x5D2D6E,(unsigned char *)mechcode,7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue