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

Method OnSphereOverlap

Source/Blaster/Weapon/Weapon.cpp:81–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81void AWeapon::OnSphereOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
82{
83 ABlasterCharacter* BlasterCharacter = Cast<ABlasterCharacter>(OtherActor);
84
85 if (BlasterCharacter)
86 {
87 if (WeaponType == EWeaponType::EWT_Flag && BlasterCharacter->GetTeam() == Team) return;
88 if (BlasterCharacter->IsHoldingTheFlag()) return;
89 BlasterCharacter->SetOverlappingWeapon(this);
90 }
91}
92
93void AWeapon::OnSphereEndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)
94{

Callers

nothing calls this directly

Calls 3

IsHoldingTheFlagMethod · 0.80
SetOverlappingWeaponMethod · 0.80
GetTeamMethod · 0.45

Tested by

no test coverage detected