You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed some external GUI bugs. Added extra functionalility to h2 invulnerability to fix fall-timer-disappearing glitch. Fixed h2 checkpoint injection crash. Fixed multilevelpointer issue where GetLastError could give you the second-last-error instead.
Copy file name to clipboardExpand all lines: HCMInternal/InjectCheckpoint.h
+31-6Lines changed: 31 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ class InjectCheckpoint : public IOptionalCheat {
75
75
auto currentCheckpoint = sharedMem->getInjectInfo();
76
76
77
77
if (currentCheckpoint.selectedCheckpointNull) throwHCMRuntimeException("Can't inject - no checkpoint selected!");
78
-
if ((GameState)currentCheckpoint.selectedCheckpointGame != this->mImplGame) throwHCMRuntimeException(std::format("Can't inject - checkpoint from wrong game! Expected: {}, Actual: {}", mImplGame.toString(), ((GameState)currentCheckpoint.selectedCheckpointGame).toString()));
78
+
if ((GameState)currentCheckpoint.selectedCheckpointGame != this->mImplGame) throwHCMRuntimeException(std::format("Can't inject - checkpoint from wrong game! Expected: {}, Actual: {}\n(Make sure you switch HCMExternal to the correct game tab)", mImplGame.toString(), ((GameState)currentCheckpoint.selectedCheckpointGame).toString()));
79
79
80
80
81
81
//TODO: load correct level if level not aligned
@@ -181,6 +181,7 @@ class InjectCheckpoint : public IOptionalCheat {
181
181
{
182
182
bool firstCheckpoint;
183
183
mDoubleRevertFlag->readData(&firstCheckpoint);
184
+
PLOG_DEBUG << "Double revert flag value: " << firstCheckpoint;
auto loadedBSPToWrite = firstCheckpoint ? mLoadedBSP1 : mLoadedBSP2;
286
+
287
+
#if HCM_DEBUG
288
+
// attempting to debug a H2 crash
289
+
uintptr_t loadedBSPLoc;
290
+
if (!loadedBSPToWrite->resolve(&loadedBSPLoc)) throwHCMRuntimeException(std::format("Failed to resolve BSP data: {}", MultilevelPointer::GetLastError()));
if (!loadedBSPToWrite->readData(¤tLoadedBSP)) throwHCMRuntimeException(std::format("Failed to read BSP data: {}", MultilevelPointer::GetLastError()));
if (!loadedBSPToWrite->writeArrayData(currentBSPData.data(), currentBSPData.size())) throwHCMRuntimeException(std::format("Failed to write BSP data: {}", MultilevelPointer::GetLastError()));
297
+
PLOG_VERBOSE << "successfully set BSP data";
278
298
}
279
299
}
280
300
@@ -295,6 +315,7 @@ class InjectCheckpoint : public IOptionalCheat {
295
315
}
296
316
catch (HCMRuntimeException ex)
297
317
{
318
+
PLOG_VERBOSE << "error!" << ex.what();
298
319
runtimeExceptions->handleMessage(ex);
299
320
}
300
321
@@ -338,7 +359,11 @@ class InjectCheckpoint : public IOptionalCheat {
0 commit comments