Skip to content

Commit

Permalink
Fix bug in Prologue start causing forced Corpo lifepath
Browse files Browse the repository at this point in the history
  • Loading branch information
alphanin9 committed Jan 2, 2025
1 parent 68873e7 commit 524bc2e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/hooking/hooking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void OnNewGame(game::ui::CharacterCustomizationSystem* aThis, void* aRdx)

if (!state)
{
PluginContext::Error("hooking::CharacterCustomizationSystem::OnNewGame, CC state == NULL, WTF?");
PluginContext::Error("hooking::CharacterCustomizationSystem::OnNewGame, CC state == NULL");
return;
}

Expand All @@ -54,12 +54,27 @@ void OnNewGame(game::ui::CharacterCustomizationSystem* aThis, void* aRdx)

shared::raw::CharacterCustomizationState::GetLifePath(state, lifepathId);

if (lifepathId == "LifePaths.NewStart")
{
auto questsSystem = GetGameSystem<quest::QuestsSystem>();
auto questsSystem = GetGameSystem<quest::QuestsSystem>();
auto factsDB = shared::raw::QuestsSystem::FactsDB(questsSystem);

shared::raw::QuestsSystem::FactsDB(questsSystem)->SetFact("ngplus_fresh_start_on", 1);
if (lifepathId == "LifePaths.Corporate")
{
factsDB->SetFact("ngplus_is_corpo", 1);
}
else if (lifepathId == "LifePaths.StreetKid")
{
factsDB->SetFact("ngplus_is_streetkid", 1);
}
else if (lifepathId == "LifePaths.Nomad")
{
factsDB->SetFact("ngplus_is_nomad", 1);
}
else if (lifepathId == "LifePaths.NewStart")
{
factsDB->SetFact("ngplus_fresh_start_on", 1);
}

factsDB->SetFact("ngplus_cc_on_new_game_finished", 1);
}
}

Expand Down
Binary file modified wolvenkit/packed/archive/pc/mod/NewGamePlus.archive
Binary file not shown.
Binary file not shown.

0 comments on commit 524bc2e

Please sign in to comment.