This is the code for the weapon firing - can anyone indicate if there is anything in this code that would account for this significant loss of movement speed?
Code: Select all
function TraceFire( float Accuracy )
{
local vector HitLocation, HitNormal, StartTrace, EndTrace, X,Y,Z, AimDir;
local actor Other;
local Pawn PawnOwner;
PawnOwner = Pawn(Owner);
Owner.MakeNoise(PawnOwner.SoundDampening);
GetAxes(PawnOwner.ViewRotation,X,Y,Z);
StartTrace = Owner.Location + PawnOwner.Eyeheight * Z;
AdjustedAim = PawnOwner.AdjustAim(1000000, StartTrace, 2*AimError, False, False);
X = vector(AdjustedAim);
AdjustAccuracy(owner,ShotAccuracyBase,ShotAccuracy);
EndTrace = StartTrace + ShotAccuracy * (FRand() - 0.5 )* Y * 1000
+ ShotAccuracy * (FRand() - 0.5 ) * Z * 1000;
AimDir = vector(AdjustedAim);
EndTrace += (10000 * AimDir);
Other = PawnOwner.TraceShot(HitLocation,HitNormal,EndTrace,StartTrace);
//recoil
Pawn(Owner).ViewRotation.Pitch += (shotc * 8);
shotc++;
// visible tracing
Count++;
if ( Count == 3 )
{
Count = 0;
if ( VSize(HitLocation - StartTrace) > 250 ) Spawn(class'MTracerXM',,, StartTrace + 96 * AimDir,rotator(EndTrace - StartTrace));
}
ProcessTraceHit(Other, HitLocation, HitNormal, vector(AdjustedAim),Y,Z);
}
function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
{
if (Other == Level) Spawn(class'UT_HeavyWallHitEffect',,, HitLocation+HitNormal, Rotator(HitNormal));
else if ( (Other != self) && (Other != Owner) && (Other != None) )
{
if ( Other.bIsPawn )
{
ProcessHitLocation(owner,Other,HitLocation,X,HeadDamage,ArmorDamage,LegDamage);
Other.PlaySound(Sound 'ChunkHit',, 4.0,,100);
}
if ( !Other.bIsPawn && !Other.IsA('Carcass') )
spawn(class'UT_SpriteSmokePuff',,,HitLocation+HitNormal*9);
}
}
function Fire( float Value )
{
Enable('Tick');
if ( AmmoType == None )
{
// ammocheck
GiveAmmo(Pawn(Owner));
}
if ( AmmoType.UseAmmo(1) )
{
If (AClipCount> 0)
{
AclipCount--;
SoundVolume = 255;//*Pawn(Owner).SoundDampening;
Pawn(Owner).PlayRecoil(FiringSpeed);
bCanClientFire = true;
bPointing=True;
ClientFire(value);
GotoState('NormalFire');
}
else
{
GotoState('NewClip');
}
}
else GoToState('Idle');
}
This is the complete .uc for the weapon should anyone wish to look at all of it