Added an achievement fix 1.5.97-1.6.1130
This commit is contained in:
parent
9d84b0bb74
commit
8a4e3ef71b
BIN
SKSE/Plugins/EnderalSE.dll
(Stored with Git LFS)
BIN
SKSE/Plugins/EnderalSE.dll
(Stored with Git LFS)
Binary file not shown.
@ -1,3 +1,4 @@
|
||||
FlatMapMarkers = true
|
||||
StayAtSystemPage = true
|
||||
MapMarkerPlacementFixes = true
|
||||
AchievementFix = true
|
||||
|
20
source/Enderal DLL/src/AchievementFix.h
Normal file
20
source/Enderal DLL/src/AchievementFix.h
Normal file
@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
namespace AchievementFix
|
||||
{
|
||||
constexpr std::uint8_t NOP{ 0x90 };
|
||||
|
||||
void Install()
|
||||
{
|
||||
REL::Relocation<std::uintptr_t> target;
|
||||
|
||||
if (GetLoadInterface()->RuntimeVersion().minor() > 6 || GetLoadInterface()->RuntimeVersion().patch() >= 1130) {
|
||||
target = REL::ID(441528);
|
||||
} else {
|
||||
target = REL::RelocationID(13647, 13755);
|
||||
}
|
||||
|
||||
std::uint8_t code[] = { 0xB0, 0x00, 0xC3, NOP };
|
||||
REL::safe_write(target.address(), code, 4);
|
||||
}
|
||||
}
|
@ -4,13 +4,15 @@
|
||||
#include "FlatMapMarkers.h"
|
||||
#include "StayAtSystemPage.h"
|
||||
#include "MapMarkerPlacement.h"
|
||||
#include "AchievementFix.h"
|
||||
|
||||
using namespace SKSE;
|
||||
|
||||
static std::map<std::string, bool> g_settings{
|
||||
{ "FlatMapMarkers", true },
|
||||
{ "StayAtSystemPage", true },
|
||||
{ "MapMarkerPlacementFixes", true }
|
||||
{ "MapMarkerPlacementFixes", true },
|
||||
{ "AchievementFix", true }
|
||||
};
|
||||
|
||||
namespace {
|
||||
@ -150,6 +152,11 @@ SKSEPluginLoad(const LoadInterface* skse) {
|
||||
|
||||
GetPapyrusInterface()->Register(Papyrus::Bind);
|
||||
|
||||
if (g_settings.at("AchievementFix")) {
|
||||
logger::info("Patching achievements...");
|
||||
AchievementFix::Install();
|
||||
}
|
||||
|
||||
if (!IsVR()) {
|
||||
if (g_settings.at("FlatMapMarkers")) {
|
||||
logger::info("Initializing Flat Map Markers...");
|
||||
|
Loading…
Reference in New Issue
Block a user