compiler warning fixes
This commit is contained in:
parent
6fa76a8eee
commit
0ca633cad4
@ -63,14 +63,14 @@ function PostRender(Canvas C)
|
||||
local NicePlayerController nicePlayer;
|
||||
local ScrnHUD scrnHUDInstance;
|
||||
// TODO maybe use scrnhud?
|
||||
local HUDKillingFloor kfHud;
|
||||
// local HUDKillingFloor kfHud;
|
||||
local Texture barTexture;
|
||||
local int x, y, center, barWidth, offset;
|
||||
local int missesWidth, missesHeight, missesSpace;
|
||||
local int missesX, missesY;
|
||||
local Vector CamPos, ViewDir;
|
||||
local Rotator CamRot;
|
||||
local float OffsetX, BarLength, BarHeight, XL, YL, posY;
|
||||
// local Vector CamPos, ViewDir;
|
||||
// local Rotator CamRot;
|
||||
// local float OffsetX, BarLength, BarHeight, XL, YL, posY;
|
||||
|
||||
if(C == none) return;
|
||||
if(C.ViewPort == none) return;
|
||||
|
@ -450,70 +450,83 @@ function PlayFiring(){
|
||||
if(!currentContext.bIsBursting)
|
||||
FireCount ++;
|
||||
}
|
||||
// Handle setting new recoil
|
||||
simulated function HandleRecoil(float Rec){
|
||||
local int stationarySeconds;
|
||||
local rotator NewRecoilRotation;
|
||||
local NicePlayerController nicePlayer;
|
||||
local NiceHumanPawn nicePawn;
|
||||
local vector AdjustedVelocity;
|
||||
local float AdjustedSpeed;
|
||||
local KFWeapon kfWeap;
|
||||
if(Instigator != none){
|
||||
nicePlayer = NicePlayerController(Instigator.Controller);
|
||||
nicePawn = NiceHumanPawn(Instigator);
|
||||
}
|
||||
if(nicePlayer == none || nicePawn == none)
|
||||
return;
|
||||
if(bResetRecoil || nicePlayer.IsZedTimeActive() && class'NiceVeterancyTypes'.static.hasSkill(nicePlayer, class'NiceSkillEnforcerZEDBarrage')){
|
||||
Rec = 0.0;
|
||||
bResetRecoil = false;
|
||||
}
|
||||
kfWeap= KFWeapon(Weapon);
|
||||
if (kfWeap.bAimingRifle) {
|
||||
Rec *= 0.5;
|
||||
}
|
||||
if(nicePawn.stationaryTime > 0.0 && class'NiceVeterancyTypes'.static.hasSkill(nicePlayer, class'NiceSkillHeavyStablePosition')){
|
||||
stationarySeconds = Ceil(2 * nicePawn.stationaryTime) - 1;
|
||||
Rec *= FMax(0.0, 1.0 - (stationarySeconds * class'NiceSkillHeavyStablePosition'.default.recoilDampeningBonus));
|
||||
}
|
||||
if(!nicePlayer.bFreeCamera){
|
||||
if(Weapon.GetFireMode(ThisModeNum).bIsFiring || currentContext.bIsBursting){
|
||||
NewRecoilRotation.Pitch = RandRange(maxVerticalRecoilAngle * 0.5, maxVerticalRecoilAngle);
|
||||
NewRecoilRotation.Yaw = RandRange(maxHorizontalRecoilAngle * 0.5, maxHorizontalRecoilAngle);
|
||||
|
||||
if(!bRecoilRightOnly && Rand(2) == 1)
|
||||
// Handle setting new recoil
|
||||
simulated function HandleRecoil(float Rec)
|
||||
{
|
||||
local int stationarySeconds;
|
||||
local rotator NewRecoilRotation;
|
||||
local NicePlayerController nicePlayer;
|
||||
local NiceHumanPawn nicePawn;
|
||||
local vector AdjustedVelocity;
|
||||
local float AdjustedSpeed;
|
||||
local KFWeapon KFW;
|
||||
|
||||
if(Instigator != none)
|
||||
{
|
||||
nicePlayer = NicePlayerController(Instigator.Controller);
|
||||
nicePawn = NiceHumanPawn(Instigator);
|
||||
}
|
||||
if(nicePlayer == none || nicePawn == none)
|
||||
return;
|
||||
if(bResetRecoil || nicePlayer.IsZedTimeActive() && class'NiceVeterancyTypes'.static.hasSkill(nicePlayer, class'NiceSkillEnforcerZEDBarrage'))
|
||||
{
|
||||
Rec = 0.0;
|
||||
bResetRecoil = false;
|
||||
}
|
||||
KFW= KFWeapon(Weapon);
|
||||
if (KFW.bAimingRifle)
|
||||
{
|
||||
Rec *= 0.5;
|
||||
}
|
||||
if (nicePawn.stationaryTime > 0.0 && class'NiceVeterancyTypes'.static.hasSkill(nicePlayer, class'NiceSkillHeavyStablePosition'))
|
||||
{
|
||||
stationarySeconds = Ceil(2 * nicePawn.stationaryTime) - 1;
|
||||
Rec *= FMax(0.0, 1.0 - (stationarySeconds * class'NiceSkillHeavyStablePosition'.default.recoilDampeningBonus));
|
||||
}
|
||||
if (!nicePlayer.bFreeCamera)
|
||||
{
|
||||
if (Weapon.GetFireMode(ThisModeNum).bIsFiring || currentContext.bIsBursting)
|
||||
{
|
||||
NewRecoilRotation.Pitch = RandRange(maxVerticalRecoilAngle * 0.5, maxVerticalRecoilAngle);
|
||||
NewRecoilRotation.Yaw = RandRange(maxHorizontalRecoilAngle * 0.5, maxHorizontalRecoilAngle);
|
||||
|
||||
if (!bRecoilRightOnly && Rand(2) == 1)
|
||||
NewRecoilRotation.Yaw *= -1;
|
||||
|
||||
if(RecoilVelocityScale > 0){
|
||||
if(Weapon.Owner != none && Weapon.Owner.Physics == PHYS_Falling &&
|
||||
Weapon.Owner.PhysicsVolume.Gravity.Z > class'PhysicsVolume'.default.Gravity.Z){
|
||||
AdjustedVelocity = Weapon.Owner.Velocity;
|
||||
// Ignore Z velocity in low grav so we don't get massive recoil
|
||||
AdjustedVelocity.Z = 0;
|
||||
AdjustedSpeed = VSize(AdjustedVelocity);
|
||||
if (RecoilVelocityScale > 0)
|
||||
{
|
||||
if (Weapon.Owner != none && Weapon.Owner.Physics == PHYS_Falling &&
|
||||
Weapon.Owner.PhysicsVolume.Gravity.Z > class'PhysicsVolume'.default.Gravity.Z)
|
||||
{
|
||||
AdjustedVelocity = Weapon.Owner.Velocity;
|
||||
// Ignore Z velocity in low grav so we don't get massive recoil
|
||||
AdjustedVelocity.Z = 0;
|
||||
AdjustedSpeed = VSize(AdjustedVelocity);
|
||||
|
||||
// Reduce the falling recoil in low grav
|
||||
NewRecoilRotation.Pitch += (AdjustedSpeed * RecoilVelocityScale * 0.5);
|
||||
NewRecoilRotation.Yaw += (AdjustedSpeed * RecoilVelocityScale * 0.5);
|
||||
}
|
||||
else{
|
||||
NewRecoilRotation.Pitch += (VSize(Weapon.Owner.Velocity) * RecoilVelocityScale);
|
||||
NewRecoilRotation.Yaw += (VSize(Weapon.Owner.Velocity) * RecoilVelocityScale);
|
||||
}
|
||||
}
|
||||
// Reduce the falling recoil in low grav
|
||||
NewRecoilRotation.Pitch += (AdjustedSpeed * RecoilVelocityScale * 0.5);
|
||||
NewRecoilRotation.Yaw += (AdjustedSpeed * RecoilVelocityScale * 0.5);
|
||||
}
|
||||
else
|
||||
{
|
||||
NewRecoilRotation.Pitch += (VSize(Weapon.Owner.Velocity) * RecoilVelocityScale);
|
||||
NewRecoilRotation.Yaw += (VSize(Weapon.Owner.Velocity) * RecoilVelocityScale);
|
||||
}
|
||||
}
|
||||
|
||||
NewRecoilRotation.Pitch += (Instigator.HealthMax / Instigator.Health * 5);
|
||||
NewRecoilRotation.Yaw += (Instigator.HealthMax / Instigator.Health * 5);
|
||||
NewRecoilRotation *= Rec;
|
||||
NewRecoilRotation.Pitch += (Instigator.HealthMax / Instigator.Health * 5);
|
||||
NewRecoilRotation.Yaw += (Instigator.HealthMax / Instigator.Health * 5);
|
||||
NewRecoilRotation *= Rec;
|
||||
|
||||
if(default.FireRate <= 0)
|
||||
nicePlayer.SetRecoil(NewRecoilRotation, RecoilRate);
|
||||
else
|
||||
nicePlayer.SetRecoil(NewRecoilRotation, RecoilRate * (FireRate / default.FireRate));
|
||||
}
|
||||
}
|
||||
if (default.FireRate <= 0)
|
||||
nicePlayer.SetRecoil(NewRecoilRotation, RecoilRate);
|
||||
else
|
||||
nicePlayer.SetRecoil(NewRecoilRotation, RecoilRate * (FireRate / default.FireRate));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function DoFireEffect(){
|
||||
local bool bIsShotgunBullet, bForceComplexTraj;
|
||||
local bool bPinpoint;
|
||||
|
Loading…
Reference in New Issue
Block a user