Skip to content

Commit

Permalink
fix: Completely Disable freeze check with ini setting
Browse files Browse the repository at this point in the history
  • Loading branch information
SaneEngineer committed Sep 15, 2024
1 parent 5a8bfbe commit 2b4c128
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
cmake_minimum_required(VERSION 3.21)
set(NAME "NGIO-NG" CACHE STRING "")
set(VERSION 1.0.14 CACHE STRING "")
set(VERSION 1.1.0 CACHE STRING "")
set(VR_VERSION 1)
set(AE_VERSION 1)

option(COPY_BUILD "Copy the build output to the Skyrim directory." FALSE)
option(BUILD_SKYRIMVR "Build for Skyrim VR" OFF)
option(BUILD_SKYRIMAE "Build for Skyrim AE" OFF)
option(BUILD_ZIP "Create a 7z archive." FALSE)
option(BUILD_ZIP "Create a 7z archive." TRUE)

# ---- Cache build vars ----
macro(set_from_environment VARIABLE)
Expand Down
9 changes: 3 additions & 6 deletions src/GidFileCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,9 @@ namespace GrassControl
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
continue;
}
if (Config::FreezeCheck) {
RE::DebugMessageBox("Grass generation appears to have frozen! Restart the game.");
Util::report_and_fail_timed("Grass generation appears to have frozen! Restart the game.");
} else {
logger::info("Grass generation appears to have frozen!");
}

RE::DebugMessageBox("Grass generation appears to have frozen! Restart the game.");
Util::report_and_fail_timed("Grass generation appears to have frozen! Restart the game.");
}
}

Expand Down
11 changes: 6 additions & 5 deletions src/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ namespace GrassControl

GidFileGenerationTask::cur_state = 1;

GidFileGenerationTask::_lastDidSomething = GetTickCount64();
std::thread t(GidFileGenerationTask::run_freeze_check);
t.detach();
if (Config::FreezeCheck) {
GidFileGenerationTask::_lastDidSomething = GetTickCount64();
std::thread t(GidFileGenerationTask::run_freeze_check);
t.detach();
}

auto gf = std::make_unique<GidFileGenerationTask>();
GidFileGenerationTask::cur_instance = std::move(gf);
Expand Down Expand Up @@ -81,7 +83,6 @@ namespace GrassControl

auto fi = std::filesystem::path(Util::getProgressFilePath());
if (Config::UseGrassCache && exists(fi)) {

#ifdef SKYRIMVR
auto setting = RE::INISettingCollection::GetSingleton()->GetSetting("bLoadVRPlayroom:VR");
if (!setting) {
Expand All @@ -103,7 +104,7 @@ namespace GrassControl
} else if (Config::UseGrassCache) {
logger::info("Grass Cache is Enabled. PrecacheGrass.txt is not detected, assuming normal usage.");
} else {
logger::info("Grass Cache is Disabled");
logger::info("Grass Cache is Disabled");
}

switch (Config::DynDOLODGrassMode) {
Expand Down

0 comments on commit 2b4c128

Please sign in to comment.