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)
|
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)
|
/* if (bEnableBotTick)
|
||||||
{
|
{
|
||||||
Bots::Tick();
|
Bots::Tick();
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ extern inline int AmountOfBotsToSpawn = 0;
|
|||||||
extern inline bool bEnableRebooting = false;
|
extern inline bool bEnableRebooting = false;
|
||||||
extern inline bool bEngineDebugLogs = false;
|
extern inline bool bEngineDebugLogs = false;
|
||||||
extern inline bool bStartedBus = false;
|
extern inline bool bStartedBus = false;
|
||||||
|
extern inline bool bShouldDestroyAllPlayerBuilds = false;
|
||||||
extern inline int AmountOfHealthSiphon = 0;
|
extern inline int AmountOfHealthSiphon = 0;
|
||||||
|
|
||||||
// THE BASE CODE IS FROM IMGUI GITHUB
|
// THE BASE CODE IS FROM IMGUI GITHUB
|
||||||
@@ -1080,19 +1081,7 @@ static inline void MainUI()
|
|||||||
|
|
||||||
if (ImGui::Button("Destroy all player builds"))
|
if (ImGui::Button("Destroy all player builds"))
|
||||||
{
|
{
|
||||||
auto AllBuildingSMActors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), ABuildingSMActor::StaticClass());
|
bShouldDestroyAllPlayerBuilds = true;
|
||||||
|
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::Button("Give Item to Everyone"))
|
if (ImGui::Button("Give Item to Everyone"))
|
||||||
|
|||||||
Reference in New Issue
Block a user