Skip to content

Commit

Permalink
fix: fix caching in VR
Browse files Browse the repository at this point in the history
  • Loading branch information
SaneEngineer committed May 4, 2024
1 parent 6d901f8 commit f799a49
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/GrassControl/GidFileCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ namespace GrassControl
{
static void thunk(RE::TESObjectCELL* cell)
{
InterlockedIncrement64(&queued_grass_counter);
if(strcmp(cell->worldSpace->editorID.c_str(), "VRPlayroom") != 0) {
InterlockedIncrement64(&queued_grass_counter);
}
func(cell);
}
static inline REL::Relocation<decltype(thunk)> func;
Expand All @@ -159,7 +161,7 @@ namespace GrassControl
static void thunk(uintptr_t GrassMgr, RE::TESObjectCELL* cell, uintptr_t unk)
{
func(GrassMgr, cell, unk);
if (IsApplying) {
if (IsApplying && strcmp(cell->worldSpace->editorID.c_str(), "VRPlayroom") != 0) {
if (cell != nullptr) {
auto ws = cell->worldSpace;
if (ws != nullptr) {
Expand Down
2 changes: 2 additions & 0 deletions src/Events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ RE::BSEventNotifyControl MenuOpenCloseEventHandler::ProcessEvent(const RE::MenuO
if (a_event) {
#ifndef NDEBUG
if (a_event->menuName == RE::Console::MENU_NAME) {
#elif SKYRIMVR
if (a_event->menuName == RE::Console::MENU_NAME) {
#else
if (a_event->menuName == RE::MainMenu::MENU_NAME) {
#endif
Expand Down
3 changes: 3 additions & 0 deletions src/GidFileCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,9 @@ namespace GrassControl
char Char = ';';
auto skip = Util::StringHelpers::split(Config::SkipPregenerateWorldSpaces, Char, true);
auto skipSet = std::unordered_set<std::string, case_insensitive_unordered_set::hash, case_insensitive_unordered_set::comp>();
#ifdef SKYRIMVR
skipSet.insert("VRPlayroom");
#endif
for (auto& x : skip) {
logger::info("Skipping: {}", x);
skipSet.insert(x);
Expand Down

0 comments on commit f799a49

Please sign in to comment.