mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-03 14:18:46 +00:00
add a new heroes push back abilities
This commit is contained in:
@@ -23,8 +23,12 @@ void ACogAbilityReplicator::Create(APlayerController* Controller)
|
||||
ACogAbilityReplicator::ACogAbilityReplicator(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
#if !UE_BUILD_SHIPPING
|
||||
|
||||
bReplicates = true;
|
||||
RootComponent = ObjectInitializer.CreateOptionalDefaultSubobject<USceneComponent>(this, TEXT("Root"));
|
||||
bOnlyRelevantToOwner = true;
|
||||
|
||||
#endif // !UE_BUILD_SHIPPING
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -40,20 +44,23 @@ void ACogAbilityReplicator::GetLifetimeReplicatedProps(TArray< FLifetimeProperty
|
||||
DOREPLIFETIME_WITH_PARAMS_FAST(ACogAbilityReplicator, TweakProfileIndex, Params);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void ACogAbilityReplicator::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
OwnerPlayerController = Cast<APlayerController>(GetOwner());
|
||||
|
||||
if (OwnerPlayerController->IsLocalController())
|
||||
if (OwnerPlayerController != nullptr)
|
||||
{
|
||||
FCogAbilityModule::Get().SetLocalReplicator(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
FCogAbilityModule::Get().AddRemoteReplicator(this);
|
||||
if (OwnerPlayerController->IsLocalController())
|
||||
{
|
||||
FCogAbilityModule::Get().SetLocalReplicator(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
FCogAbilityModule::Get().AddRemoteReplicator(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -155,11 +155,11 @@ void UCogAbilityWindow_Cheats::RequestCheat(AActor* CheatInstigator, AActor* Sel
|
||||
|
||||
if (ICogInterfacesAllegianceActor* AllegianceInterface = Cast<ICogInterfacesAllegianceActor>(OtherActor))
|
||||
{
|
||||
AllegianceInterface->GetAllegiance(CheatInstigator);
|
||||
AllegianceInterface->GetAllegianceWithOtherActor(CheatInstigator);
|
||||
}
|
||||
|
||||
if ((IsShiftDown && (Allegiance == ECogInterfacesAllegiance::Enemy))
|
||||
|| (IsAltDown && (Allegiance == ECogInterfacesAllegiance::Ally)))
|
||||
|| (IsAltDown && (Allegiance == ECogInterfacesAllegiance::Friendly)))
|
||||
{
|
||||
Actors.Add(OtherActor);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user