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