Ed_
c2e5793a7d
There is some jank, with the ability system init on character (I'll fix later). Cog replaces the usuals showdebug command
37 lines
789 B
C++
37 lines
789 B
C++
#include "PlayerCharacter.h"
|
|
|
|
#include "AbilitySystemComponent.h"
|
|
|
|
APlayerCharacter::APlayerCharacter()
|
|
{
|
|
PrimaryActorTick.bCanEverTick = true;
|
|
|
|
bAutoAbilitySystem = false;
|
|
}
|
|
|
|
void APlayerCharacter::PossessedBy(AController* NewController)
|
|
{
|
|
Super::PossessedBy(NewController);
|
|
|
|
AGasaPlayerState* PS = GetGasaPlayerState();
|
|
// Server setup ability system (character side)
|
|
{
|
|
AbilitySystem = PS->AbilitySystem;
|
|
Attributes = PS->Attributes;
|
|
AbilitySystem->InitAbilityActorInfo(PS, this);
|
|
}
|
|
}
|
|
|
|
void APlayerCharacter::OnRep_PlayerState()
|
|
{
|
|
Super::OnRep_PlayerState();
|
|
|
|
AGasaPlayerState* PS = GetGasaPlayerState();
|
|
// Client setup ability system
|
|
{
|
|
AbilitySystem = PS->AbilitySystem;
|
|
Attributes = PS->Attributes;
|
|
AbilitySystem->InitAbilityActorInfo(PS, this);
|
|
}
|
|
}
|