Fixed some bugs with party spawning getting called twice, cleaned up the battle state machine start logic

feature/pre-battle-menu
Jers 11 months ago
parent 74695d1319
commit 09746d1a25

BIN
Content/Blueprints/BP_GameState.uasset (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Levels/BattleMap.umap (Stored with Git LFS)

Binary file not shown.

@ -61,6 +61,7 @@ void UPartySubsystem::SpawnUnits()
if(i + LastSpawnIndex >= SpawnQueue.Num()) if(i + LastSpawnIndex >= SpawnQueue.Num())
{ {
GetWorld()->GetTimerManager().ClearTimer(SpawnTimerHandle); GetWorld()->GetTimerManager().ClearTimer(SpawnTimerHandle);
LastSpawnIndex += i;
return; return;
} }
@ -153,4 +154,26 @@ void UPartySubsystem::SetMemberUnitInfo(FPartyMember& Member, UUnitInfo* InUnitI
UUnitInfo* UPartySubsystem::GetMemberUnitInfo(FPartyMember& Member) const UUnitInfo* UPartySubsystem::GetMemberUnitInfo(FPartyMember& Member) const
{ {
return Member.UnitInfo; return Member.UnitInfo;
}
int32 UPartySubsystem::GetTotalAvailablePartyMembers()
{
int32 Total = 0;
for(auto const Member : Members)
{
Total += Member.Available;
}
return Total;
}
int32 UPartySubsystem::GetTotalAllocatedPartyMembers()
{
int32 Total = 0;
for(auto const Member : Members)
{
Total += Member.Allocated;
}
return Total;
} }

@ -57,6 +57,12 @@ public:
UFUNCTION(BlueprintCallable) UFUNCTION(BlueprintCallable)
UUnitInfo* GetMemberUnitInfo(UPARAM(ref) FPartyMember& Member) const; UUnitInfo* GetMemberUnitInfo(UPARAM(ref) FPartyMember& Member) const;
UFUNCTION(BlueprintCallable)
int32 GetTotalAvailablePartyMembers();
UFUNCTION(BlueprintCallable)
int32 GetTotalAllocatedPartyMembers();
protected: protected:
void SpawnUnits(); void SpawnUnits();

Loading…
Cancel
Save