From 843ea96cebdd5d0a2f3929671c74f6a0a09b2010 Mon Sep 17 00:00:00 2001 From: parax0 Date: Tue, 22 Mar 2016 01:29:17 -0600 Subject: [PATCH] Fixed PakTool dialog not having a parent assigned, fixed a crash when attempting to clone SCGN objects --- src/Core/Resource/Script/CScriptLayer.h | 3 +++ src/Editor/CStartWindow.cpp | 4 ++-- src/Editor/WorldEditor/CWorldEditor.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Core/Resource/Script/CScriptLayer.h b/src/Core/Resource/Script/CScriptLayer.h index 4bd8ae35..02c150a2 100644 --- a/src/Core/Resource/Script/CScriptLayer.h +++ b/src/Core/Resource/Script/CScriptLayer.h @@ -107,6 +107,9 @@ public: return iLyr; } + if (mpArea->GetGeneratorLayer() == this) + return mpArea->GetScriptLayerCount(); + return -1; } diff --git a/src/Editor/CStartWindow.cpp b/src/Editor/CStartWindow.cpp index 02003341..8808f72e 100644 --- a/src/Editor/CStartWindow.cpp +++ b/src/Editor/CStartWindow.cpp @@ -224,10 +224,10 @@ void CStartWindow::on_actionExtract_PAK_triggered() if (!Pak.isEmpty()) { - CPakToolDialog::EResult Result = CPakToolDialog::Extract(Pak); + CPakToolDialog::EResult Result = CPakToolDialog::Extract(Pak, 0, this); if (Result == CPakToolDialog::eSuccess) - Result = CPakToolDialog::DumpList(Pak); + Result = CPakToolDialog::DumpList(Pak, 0, this); if (Result == CPakToolDialog::eSuccess) QMessageBox::information(this, "Success", "Extracted pak successfully!"); diff --git a/src/Editor/WorldEditor/CWorldEditor.cpp b/src/Editor/WorldEditor/CWorldEditor.cpp index 4bfb2b27..72aacda9 100644 --- a/src/Editor/WorldEditor/CWorldEditor.cpp +++ b/src/Editor/WorldEditor/CWorldEditor.cpp @@ -371,7 +371,7 @@ bool CWorldEditor::SaveAndRepack() } QString PakOut; - CPakToolDialog::EResult Result = CPakToolDialog::Repack(CurrentGame(), mPakTarget, mPakFileList, mWorldDir, &PakOut); + CPakToolDialog::EResult Result = CPakToolDialog::Repack(CurrentGame(), mPakTarget, mPakFileList, mWorldDir, &PakOut, this); if (Result == CPakToolDialog::eError) QMessageBox::warning(this, "Error", "Failed to repack!");