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

Method ResetFlag

Source/Blaster/Weapon/Flag.cpp:30–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30void AFlag::ResetFlag()
31{
32 ABlasterCharacter* FlagBearer = Cast<ABlasterCharacter>(GetOwner());
33 if (FlagBearer)
34 {
35 FlagBearer->SetHoldingTheFlag(false);
36 FlagBearer->SetOverlappingWeapon(nullptr);
37 FlagBearer->UnCrouch();
38 }
39
40 if (!HasAuthority()) return;
41
42 FDetachmentTransformRules DetachRules(EDetachmentRule::KeepWorld, true);
43 FlagMesh->DetachFromComponent(DetachRules);
44 SetWeaponState(EWeaponState::EWS_Initial);
45 GetAreaSphere()->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
46 GetAreaSphere()->SetCollisionResponseToChannel(ECollisionChannel::ECC_Pawn, ECollisionResponse::ECR_Overlap);
47
48 SetOwner(nullptr);
49 BlasterOwnerCharacter = nullptr;
50 BlasterOwnerController = nullptr;
51
52 SetActorTransform(InitialTransform);
53}
54
55void AFlag::OnEquipped()
56{

Callers 1

OnSphereOverlapMethod · 0.80

Calls 2

SetHoldingTheFlagMethod · 0.80
SetOverlappingWeaponMethod · 0.80

Tested by

no test coverage detected