fix netplay

This commit is contained in:
cclecle
2022-12-04 18:45:44 +00:00
parent a46a8c0bcc
commit ad5b50b534
3 changed files with 47 additions and 13 deletions

View File

@@ -1,22 +1,53 @@
class MutChaChaFastWeaponSwitch extends Mutator;
var config float PutDownTime;
var config float BringUpTime;
var config float CfgPutDownTime;
var config float CfgBringUpTime;
function bool CheckReplacement( Actor Other, out byte bSuperRelevant )
var float PutDownTime;
var float BringUpTime;
replication
{
bSuperRelevant = 0;
unreliable if( ROLE==ROLE_Authority)
PutDownTime,BringUpTime;
}
if ( Weapon(Other) != None )
{
Weapon(Other).PutDownTime=PutDownTime;
Weapon(Other).BringUpTime=BringUpTime;
simulated function PreBeginPlay()
{
if( ROLE==ROLE_Authority)
Level.GRI.bFastWeaponSwitching = true;
Super.PreBeginPlay();
PutDownTime = CfgPutDownTime;
BringUpTime = CfgBringUpTime;
class'Weapon'.default.PutDownTime = PutDownTime;
class'Weapon'.default.BringUpTime = BringUpTime;
setTimer(0.5,True);
}
simulated event Timer()
{
local Weapon aWeapon;
foreach AllActors(class'Weapon', aWeapon) {
aWeapon.PutDownTime = PutDownTime;
aWeapon.BringUpTime = BringUpTime;
aWeapon.default.PutDownTime = PutDownTime;
aWeapon.default.BringUpTime = BringUpTime;
}
return true;
}
auto state Startup
{
function bool CheckReplacement( Actor Other, out byte bSuperRelevant )
@@ -37,6 +68,9 @@ defaultproperties
GroupName="MutFastWeapSwitch"
FriendlyName="Very Fast Weapons Switch"
Description="Very Fast Weapon Switching"
PutDownTime=0.1
BringUpTime=0.1
CfgPutDownTime=0.01
CfgBringUpTime=0.01
Role=ROLE_Authority
RemoteRole=ROLE_SimulatedProxy
bAlwaysRelevant=true
}

Binary file not shown.