Skip to content

Commit

Permalink
Don't run videodata in release mode, +additional safety check
Browse files Browse the repository at this point in the history
  • Loading branch information
jbzdarkid committed May 1, 2024
1 parent 4f3cf6e commit 94aa2ab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions App/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,9 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
if (++update % 10 == 0) {
SetPosAndAngText(g_currentPos, g_trainer->GetCameraPos(), g_trainer->GetCameraAng());
SetActivePanel(g_trainer->GetActivePanel());
#if _DEBUG
SetVideoData(g_trainer->GetVideoData());
#endif
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion App/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#define MAJOR 1
#define MINOR 8
#define PATCH 7
#define PATCH 8

#define VERSION_STR TO_STRING(MAJOR) L"." TO_STRING(MINOR) L"." TO_STRING(PATCH)
#define VERSION MAJOR, MINOR, PATCH
Expand Down
2 changes: 2 additions & 0 deletions Source/Trainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ void Trainer::GetDoorData(const std::shared_ptr<Trainer::EntityData>& data) {
}

Trainer::VideoData Trainer::GetVideoData() {
if (_binkInfoData == 0) return {};

VideoData videoData;
videoData.fileName = _memory->ReadString({_binkInfoData, 0x0, 0x18});
if (!videoData.fileName.empty()) {
Expand Down

0 comments on commit 94aa2ab

Please sign in to comment.