Skip to content

Commit

Permalink
Unlock Zoom If Server Forces Client(Alt)Fire
Browse files Browse the repository at this point in the history
  • Loading branch information
Deaod committed Feb 3, 2024
1 parent 30b4aee commit 21360a9
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions Classes/ST_SniperRifle.uc
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,22 @@ simulated function bool ClientAltFire(float Value) {
return true;
}

simulated function ForceClientFire() {
if (Owner.IsA('PlayerPawn') && PlayerPawn(Owner).Player.IsA('ViewPort')) {
ZoomState = ZS_Idle;
}

super.ForceClientFire();
}

simulated function ForceClientAltFire() {
if (Owner.IsA('PlayerPawn') && PlayerPawn(Owner).Player.IsA('ViewPort')) {
ZoomState = ZS_Idle;
}

super.ForceClientAltFire();
}

simulated function Tick(float DeltaTime) {
local PlayerPawn P;
if (Owner != none &&
Expand Down Expand Up @@ -224,5 +240,29 @@ simulated function Tick(float DeltaTime) {
}
}

state ClientActive {
simulated function ForceClientFire()
{
Global.ForceClientFire();
}

simulated function ForceClientAltFire()
{
Global.ForceClientAltFire();
}
}

state ClientDown {
simulated function ForceClientFire()
{
Global.ForceClientFire();
}

simulated function ForceClientAltFire()
{
Global.ForceClientAltFire();
}
}

defaultproperties {
}

0 comments on commit 21360a9

Please sign in to comment.