quite a bit

llamas, fix some ltm specific stuff, add auto bus start for auto restart,  work in progress lategame on 1.11, fix a crash, performance
This commit is contained in:
Milxnor
2023-05-04 20:46:48 -04:00
parent f49f166c2d
commit a4ed589aab
31 changed files with 477 additions and 93 deletions

View File

@@ -3,6 +3,7 @@
#include "reboot.h"
#include "FortPlayerStateAthena.h"
#include "FortGameModeAthena.h"
#include "FortAthenaMutator.h"
/* void AFortGameStateAthena::AddPlayerStateToGameMemberInfo(class AFortPlayerStateAthena* PlayerState)
{
@@ -36,6 +37,33 @@ TScriptInterface<UFortSafeZoneInterface> AFortGameStateAthena::GetSafeZoneInterf
return ScriptInterface;
}
void AFortGameStateAthena::SetGamePhaseStep(EAthenaGamePhaseStep NewGamePhaseStep)
{
this->GetGamePhaseStep() = NewGamePhaseStep;
std::vector<std::pair<AFortAthenaMutator*, UFunction*>> FunctionsToCall;
LoopMutators([&](AFortAthenaMutator* Mutator) { FunctionsToCall.push_back(std::make_pair(Mutator, Mutator->FindFunction("OnGamePhaseStepChanged"))); });
for (auto& FunctionToCallPair : FunctionsToCall)
{
// On newer versions there is a second param.
LOG_INFO(LogDev, "A1: {} FunctionToCallPair.second: {}", FunctionToCallPair.first->IsValidLowLevel() ? FunctionToCallPair.first->GetFullName() : "BadRead", __int64(FunctionToCallPair.second));
if (FunctionToCallPair.second->IsValidLowLevel() && FunctionToCallPair.first->IsValidLowLevel())
{
auto Params = ConstructOnGamePhaseStepChangedParams(NewGamePhaseStep);
if (Params)
{
FunctionToCallPair.first->ProcessEvent(FunctionToCallPair.second, Params);
VirtualFree(Params, 0, MEM_RELEASE);
}
}
}
}
UFortPlaylist*& AFortGameStateAthena::GetCurrentPlaylist()
{
static auto CurrentPlaylistInfoOffset = GetOffset("CurrentPlaylistInfo", false);