ApplyLaserState Instigator accessed none fix
This commit is contained in:
parent
f93d1d4761
commit
8609b8fef8
@ -1331,55 +1331,72 @@ function SetNiceData(NicePlainData.Data transferData, optional NiceHumanPawn new
|
||||
secondaryCharge = class'NicePlainData'.static.GetInt(transferData, "ChargeAmount", 1);
|
||||
ClientSetSndCharge(secondaryCharge);
|
||||
}
|
||||
simulated function ApplyLaserState(){
|
||||
|
||||
simulated function ApplyLaserState()
|
||||
{
|
||||
bLaserActive = LaserType > 0;
|
||||
if(Role < ROLE_Authority)
|
||||
ServerSetLaserType(LaserType);
|
||||
if(NiceAttachment(ThirdPersonActor) != none)
|
||||
NiceAttachment(ThirdPersonActor).SetLaserType(LaserType);
|
||||
if (Role < ROLE_Authority)
|
||||
ServerSetLaserType(LaserType);
|
||||
if (NiceAttachment(ThirdPersonActor) != none)
|
||||
NiceAttachment(ThirdPersonActor).SetLaserType(LaserType);
|
||||
|
||||
if(!Instigator.IsLocallyControlled())
|
||||
return;
|
||||
// Instigator accessed none fix
|
||||
if (Instigator == none || !Instigator.IsLocallyControlled())
|
||||
return;
|
||||
|
||||
if(bLaserActive){
|
||||
if(LaserDot == none)
|
||||
LaserDot = Spawn(LaserDotClass, self);
|
||||
LaserDot.SetLaserType(LaserType);
|
||||
if(altLaserAttachmentBone != ''){
|
||||
if(altLaserDot == none)
|
||||
altLaserDot = Spawn(LaserDotClass, self);
|
||||
altLaserDot.SetLaserType(LaserType);
|
||||
}
|
||||
//spawn 1-st person laser attachment for weapon owner
|
||||
if(LaserAttachment == none){
|
||||
SetBoneRotation(LaserAttachmentBone, LaserAttachmentRotation);
|
||||
LaserAttachment = Spawn(LaserAttachmentClass,,,,);
|
||||
AttachToBone(LaserAttachment, LaserAttachmentBone);
|
||||
if(LaserAttachment != none)
|
||||
LaserAttachment.SetRelativeLocation(LaserAttachmentOffset);
|
||||
}
|
||||
if(altLaserAttachment == none && altLaserAttachmentBone != ''){
|
||||
SetBoneRotation(altLaserAttachmentBone, altLaserAttachmentRotation);
|
||||
altLaserAttachment = Spawn(LaserAttachmentClass,,,,);
|
||||
AttachToBone(altLaserAttachment, altLaserAttachmentBone);
|
||||
if(altLaserAttachment != none)
|
||||
altLaserAttachment.SetRelativeLocation(altLaserAttachmentOffset);
|
||||
}
|
||||
ConstantColor'ScrnTex.Laser.LaserColor'.Color = LaserDot.GetLaserColor();
|
||||
LaserAttachment.bHidden = false;
|
||||
altLaserAttachment.bHidden = false;
|
||||
if (bLaserActive)
|
||||
{
|
||||
if (LaserDot == none)
|
||||
LaserDot = Spawn(LaserDotClass, self);
|
||||
LaserDot.SetLaserType(LaserType);
|
||||
if (altLaserAttachmentBone != '')
|
||||
{
|
||||
if (altLaserDot == none)
|
||||
altLaserDot = Spawn(LaserDotClass, self);
|
||||
altLaserDot.SetLaserType(LaserType);
|
||||
}
|
||||
// spawn 1-st person laser attachment for weapon owner
|
||||
if (LaserAttachment == none)
|
||||
{
|
||||
SetBoneRotation(LaserAttachmentBone, LaserAttachmentRotation);
|
||||
LaserAttachment = Spawn(LaserAttachmentClass,,,,);
|
||||
if (LaserAttachment != none)
|
||||
{
|
||||
AttachToBone(LaserAttachment, LaserAttachmentBone);
|
||||
LaserAttachment.SetRelativeLocation(LaserAttachmentOffset);
|
||||
}
|
||||
}
|
||||
else
|
||||
LaserAttachment.bHidden = false;
|
||||
|
||||
if (altLaserAttachment == none && altLaserAttachmentBone != '')
|
||||
{
|
||||
SetBoneRotation(altLaserAttachmentBone, altLaserAttachmentRotation);
|
||||
altLaserAttachment = Spawn(LaserAttachmentClass,,,,);
|
||||
if (altLaserAttachment != none)
|
||||
{
|
||||
AttachToBone(altLaserAttachment, altLaserAttachmentBone);
|
||||
altLaserAttachment.SetRelativeLocation(altLaserAttachmentOffset);
|
||||
}
|
||||
}
|
||||
else
|
||||
altLaserAttachment.bHidden = false;
|
||||
|
||||
ConstantColor'ScrnTex.Laser.LaserColor'.Color = LaserDot.GetLaserColor();
|
||||
}
|
||||
else{
|
||||
if(LaserAttachment != none)
|
||||
LaserAttachment.bHidden = true;
|
||||
if(altLaserAttachment != none)
|
||||
altLaserAttachment.bHidden = true;
|
||||
if(LaserDot != none)
|
||||
LaserDot.Destroy();
|
||||
if(altLaserDot != none)
|
||||
altLaserDot.Destroy();
|
||||
else
|
||||
{
|
||||
if (LaserAttachment != none)
|
||||
LaserAttachment.bHidden = true;
|
||||
if (altLaserAttachment != none)
|
||||
altLaserAttachment.bHidden = true;
|
||||
if (LaserDot != none)
|
||||
LaserDot.Destroy();
|
||||
if (altLaserDot != none)
|
||||
altLaserDot.Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
simulated function ToggleLaser(){
|
||||
if(!Instigator.IsLocallyControlled())
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user