MCPcopy Create free account
hub / github.com/DruidMech/MultiplayerCourseBlasterGame / OnEquipped

Method OnEquipped

Source/Blaster/Weapon/Weapon.cpp:209–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209void AWeapon::OnEquipped()
210{
211 ShowPickupWidget(false);
212 AreaSphere->SetCollisionEnabled(ECollisionEnabled::NoCollision);
213 WeaponMesh->SetSimulatePhysics(false);
214 WeaponMesh->SetEnableGravity(false);
215 WeaponMesh->SetCollisionEnabled(ECollisionEnabled::NoCollision);
216 if (WeaponType == EWeaponType::EWT_SubmachineGun)
217 {
218 WeaponMesh->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
219 WeaponMesh->SetEnableGravity(true);
220 WeaponMesh->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore);
221 }
222 EnableCustomDepth(false);
223
224 BlasterOwnerCharacter = BlasterOwnerCharacter == nullptr ? Cast<ABlasterCharacter>(GetOwner()) : BlasterOwnerCharacter;
225 if (BlasterOwnerCharacter && bUseServerSideRewind)
226 {
227 BlasterOwnerController = BlasterOwnerController == nullptr ? Cast<ABlasterPlayerController>(BlasterOwnerCharacter->Controller) : BlasterOwnerController;
228 if (BlasterOwnerController && HasAuthority() && !BlasterOwnerController->HighPingDelegate.IsBound())
229 {
230 BlasterOwnerController->HighPingDelegate.AddDynamic(this, &AWeapon::OnPingTooHigh);
231 }
232 }
233}
234
235void AWeapon::OnDropped()
236{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected