Use console commands to start MQ102 on Vault exit

Replace direct TESQuest::SetStage usage with console commands to reliably start and advance MQ102 when leaving COVault109. TryStartOutOfTimeQuest now includes RE::Console, issues `startquest MQ102` and `setstage MQ102 10`, and uses a static one-time guard (outOfTimeQuestStartIssued) to avoid repeated issuance. Removed the unreliable currentStage check and adjusted constants/naming and log output. Updated changelog and dev-log to document the implementation and touched compiled script binary.
This commit is contained in:
2026-06-30 22:46:06 +12:00
parent 771f855f89
commit a6d4cc2ba6
4 changed files with 26 additions and 18 deletions
+18 -13
View File
@@ -13,6 +13,7 @@
#include "RE/B/BIPED_OBJECT.h"
#include "RE/B/BipedAnim.h"
#include "RE/B/BSFixedString.h"
#include "RE/C/Console.h"
#include "RE/I/IAnimationGraphManagerHolder.h"
#include <algorithm>
@@ -671,7 +672,12 @@ namespace
void TryStartOutOfTimeQuest()
{
constexpr auto MQ102_FORM_ID = 0x0001CC2A;
constexpr auto MQ102_TARGET_STAGE = 10;
constexpr auto kMQ102TargetStage = 10;
static bool outOfTimeQuestStartIssued = false;
if (outOfTimeQuestStartIssued) {
return;
}
auto* dataHandler = RE::TESDataHandler::GetSingleton();
if (!dataHandler) {
@@ -685,15 +691,14 @@ namespace
return;
}
if (quest->currentStage != 0) {
return;
}
quest->SetStage(MQ102_TARGET_STAGE);
outOfTimeQuestStartIssued = true;
RE::Console::ExecuteCommand("startquest MQ102");
RE::Console::ExecuteCommand("setstage MQ102 10");
LogInfoWithLocalPlayerPrefix(std::format(
"Started quest MQ102 (Out of Time) and set to stage {}, triggered by leaving COVault109.",
MQ102_TARGET_STAGE));
"Issued startquest MQ102 and setstage MQ102 {} after leaving COVault109; previous currentStage={}.",
kMQ102TargetStage,
quest->currentStage));
}
const char* GetSpecialMovementType(
@@ -794,11 +799,11 @@ namespace
LogInfoWithLocalPlayerPrefix("COVault109 is a solo cell; sending entry location update before suppressing further transforms.");
}
if (soloCellTransformSuppressed) {
LogInfoWithLocalPlayerPrefix("Local player left solo cell; transform packet sending resumed.");
TryStartOutOfTimeQuest();
soloCellTransformSuppressed = false;
}
if (soloCellTransformSuppressed) {
LogInfoWithLocalPlayerPrefix("Local player left solo cell; transform packet sending resumed.");
TryStartOutOfTimeQuest();
soloCellTransformSuppressed = false;
}
if (!hasLastTransform) {
lastSentTransform = currentTransform;