mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
fixed destroy all player builds
This commit is contained in:
@@ -31,6 +31,24 @@ void UNetDriver::RemoveNetworkActor(AActor* Actor)
|
||||
|
||||
void UNetDriver::TickFlushHook(UNetDriver* NetDriver)
|
||||
{
|
||||
if (bShouldDestroyAllPlayerBuilds) // i hate this
|
||||
{
|
||||
auto AllBuildingSMActors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), ABuildingSMActor::StaticClass());
|
||||
|
||||
for (int i = 0; i < AllBuildingSMActors.Num(); i++)
|
||||
{
|
||||
auto CurrentBuildingSMActor = (ABuildingSMActor*)AllBuildingSMActors.at(i);
|
||||
|
||||
if (CurrentBuildingSMActor->IsDestroyed() || CurrentBuildingSMActor->IsActorBeingDestroyed() || !CurrentBuildingSMActor->IsPlayerPlaced()) continue;
|
||||
|
||||
CurrentBuildingSMActor->SilentDie();
|
||||
// CurrentBuildingSMActor->K2_DestroyActor();
|
||||
}
|
||||
|
||||
AllBuildingSMActors.Free();
|
||||
bShouldDestroyAllPlayerBuilds = false;
|
||||
}
|
||||
|
||||
/* if (bEnableBotTick)
|
||||
{
|
||||
Bots::Tick();
|
||||
|
||||
Reference in New Issue
Block a user