performance, cheat setpickaxe (untested), cheat load, auto restart (untested),
This commit is contained in:
Milxnor
2023-04-29 08:55:57 -04:00
parent 9f0990a696
commit cda077d6f8
18 changed files with 25023 additions and 81 deletions

View File

@@ -21,6 +21,7 @@
#include "FortAbilitySet.h"
#include "vendingmachine.h"
#include "KismetSystemLibrary.h"
#include "gui.h"
void AFortPlayerController::ClientReportDamagedResourceBuilding(ABuildingSMActor* BuildingSMActor, EFortResourceType PotentialResourceType, int PotentialResourceCount, bool bDestroyed, bool bJustHitWeakspot)
{
@@ -1099,6 +1100,23 @@ DWORD WINAPI SpectateThread(LPVOID)
return 0;
}
DWORD WINAPI RestartThread(LPVOID)
{
// We should probably use unreal engine's timing system for this.
// There is no way to restart that I know of without closing the connection to the clients.
bIsInAutoRestart = true;
float SecondsBeforeRestart = 10;
Sleep(SecondsBeforeRestart * 1000);
Restart();
bIsInAutoRestart = false;
return 0;
}
void AFortPlayerController::ClientOnPawnDiedHook(AFortPlayerController* PlayerController, void* DeathReport)
{
auto GameState = Cast<AFortGameStateAthena>(((AFortGameMode*)GetWorld()->GetGameMode())->GetGameState());
@@ -1302,6 +1320,11 @@ void AFortPlayerController::ClientOnPawnDiedHook(AFortPlayerController* PlayerCo
}
}
}
if (GameState->GetGamePhase() == EAthenaGamePhase::EndGame)
{
CreateThread(0, 0, RestartThread, 0, 0, 0);
}
}
}