
Originally Posted by
Ray Jones 312
@lentinant
Thanks anyway, but believe me when I say I've tried that. I see no modification to groundspeed relating to ironsighting in either his pawnclass, playercontroller, master weapon class, or inventory manager.
There is, but the check is under tfpPawn::IsRunning() & tfpPawn::IsWalking().
In SetWalking, if the player is NOT running, GroundSpeed is multiplied by 0.35.
tfpPawn.uc
Code:
/*
IsRunning
Return true if we are running... which at the moment is true so long as we're not aiming.
*/
simulated function bool IsRunning()
{
return (bWeaponAiming == false);
}
Code:
/*
SetWalking
KRIS - Used to toggle sprinting and set ground speed.
*/
event SetWalking(bool bNewIsWalking)
{
local vector X, Y, Z, Dir;
local bool bWasSprinting;
bWasSprinting = bIsSprinting;
if (bNewIsWalking != bWantsToSprint)
bWantsToSprint = bNewIsWalking;
// if don't want to sprint anymore, clear bNeedToReleaseSprint
if (bNeedToReleaseSprint && !bWantsToSprint)
bNeedToReleaseSprint = false;
GetAxes(Rotation, X, Y, Z);
Dir = Normal(Acceleration);
// only switch to sprinting if not strafing and moving forward
if (bWantsToSprint && !bNeedToReleaseSprint && (Physics == PHYS_Walking)
&& !IsTimerActive('ChangingWeaponsFinished') && !IsTimerActive('PickupFinished') && (Abs(Y Dot Dir) < 0.5) && ((X Dot Dir) > 0))
bIsSprinting = true;
else
bIsSprinting = false;
// just starting sprinting?
if (bIsSprinting && !bWasSprinting)
// stop aiming
SetAimState(false);
if (bIsSprinting)
{
if (GroundSpeed != Default.GroundSpeed * 1.5)
GroundSpeed = Default.GroundSpeed * 1.5;
}
else if (IsRunning())
{
if (GroundSpeed != Default.GroundSpeed)
GroundSpeed = Default.GroundSpeed;
}
else if (GroundSpeed != Default.GroundSpeed * 0.35)
GroundSpeed = Default.GroundSpeed * 0.35;
}
Bookmarks