Skip to content

Commit

Permalink
[CKPE]
Browse files Browse the repository at this point in the history
SF:
- Fixed crash by generation icons #107, disable patch CrashDump, so that it doesn't catch exceptions during these operations.
  • Loading branch information
Perchik71 committed Jan 25, 2025
1 parent c309ee0 commit 4deea1e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Creation Kit Platform Extended Core/Core/EngineSFPatches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "Engine.h"
#include "ModuleManager.h"
#include "CommandLineParser.h"

#include "Patches/SF/TESFormRESF.h"
#include "Patches/SF/ReplaceImgQSplashWnd.h"
Expand Down Expand Up @@ -64,6 +65,18 @@ namespace CreationKitPlatformExtended
new Patches::LayersWindow(),
//new Patches::RenderWindow(),
});

CommandLineParser CommandLine;
if (CommandLine.HasCommandRun())
{
auto Cmd = CommandLine.GetCommand();
auto Sep = Cmd.find_first_of(':');
if (Sep == String::npos)
return;

Cmd = Cmd.substr(0, Sep);
_MESSAGE("[SF] Console command: %s", Cmd.c_str());
}
}
}
}
24 changes: 24 additions & 0 deletions Creation Kit Platform Extended Core/Patches/CrashDumpPatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "Core/Engine.h"
#include "Core/CrashHandler.h"
#include "Core/CommandLineParser.h"
#include "CrashDumpPatch.h"

namespace CreationKitPlatformExtended
Expand Down Expand Up @@ -98,6 +99,29 @@ namespace CreationKitPlatformExtended
}
else if (verPatch == 2)
{
if (GetShortExecutableTypeFromFull(GlobalEnginePtr->GetEditorVersion()) == EDITOR_SHORT_STARFIELD)
{
CommandLineParser CommandLine;
if (CommandLine.HasCommandRun())
{
auto Cmd = CommandLine.GetCommand();
auto Sep = Cmd.find_first_of(':');
if (Sep != String::npos)
{
Cmd = Cmd.substr(0, Sep);

if (!_stricmp(Cmd.c_str(), "-GenerateInventoryIcons") ||
!_stricmp(Cmd.c_str(), "-GenerateWorkshopIcons") ||
!_stricmp(Cmd.c_str(), "-GenerateShipBuilderIcons"))
{
_MESSAGE("CrashDump patch is not compatible with \"%s\" command.", Cmd.c_str());

return false;
}
}
}
}

ScopeRelocator text; // fast patches

for (uint32_t i = 0; i < lpRelocationDatabaseItem->Count(); i++)
Expand Down
Binary file modified Creation Kit Platform Extended Core/Version/build_version.txt
Binary file not shown.
Binary file modified Creation Kit Platform Extended Core/Version/resource_version2.h
Binary file not shown.

0 comments on commit 4deea1e

Please sign in to comment.