Added a limit on path nodes for NPCs to NumPathNodes option

This commit is contained in:
NovaRain
2021-12-11 10:36:26 +08:00
parent fee4720ef5
commit bc8665b131
2 changed files with 12 additions and 2 deletions
+6 -1
View File
@@ -250,10 +250,15 @@ long __fastcall Tilemap::make_path_func(fo::GameObject* srcObject, long sourceTi
auto& dadData = m_dadData.begin();
size_t pathCounter = 1;
sfChild childData;
long node = 0;
if (maxNodes > maxPathNodes) maxNodes = maxPathNodes;
// Tweak for NumPathNodes option
if (maxNodes > 10000 && srcObject != fo::var::obj_dude && maxNodes == maxPathNodes) {
maxNodes = 10000; // limit for NPCs (maybe need less)
}
// search path tiles
while (true) {
auto& pathData = m_pathData.begin();
+6 -1
View File
@@ -1215,7 +1215,12 @@ void Graphics::init() {
}
if (Graphics::mode == 5 || Graphics::mode == 2) WinProc::SetMoveKeys();
if (HRP::Setting::IsEnabled()) HRP::MoviesScreen::SetDrawMode(Graphics::mode < 4);
if (HRP::Setting::IsEnabled()) {
HRP::MoviesScreen::SetDrawMode(Graphics::mode < 4);
// Reassign the function to avoid an unnecessary jump from the engine code
LoadGameHook::OnBeforeGameInit() += []() { WinProc::SetWindowProc(); };
}
WindowRender::init();
}