mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Removed some redundant code
This commit is contained in:
@@ -509,17 +509,16 @@ static void PipboyAvailableAtStartPatch() {
|
||||
};
|
||||
break;
|
||||
case 2:
|
||||
SafeWrite8(0x497011, 0xEB); // skip the vault suit movie check
|
||||
SafeWrite8(0x497011, CodeType::JumpShort); // skip the vault suit movie check
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void DisableHorriganPatch() {
|
||||
if (GetConfigInt("Misc", "DisableHorrigan", 0)) {
|
||||
LoadGameHook::OnAfterNewGame() += []() {
|
||||
LoadGameHook::OnAfterGameStarted() += []() {
|
||||
fo::var::Meet_Frank_Horrigan = true;
|
||||
};
|
||||
SafeWrite8(0x4C06D8, 0xEB); // skip the Horrigan encounter check
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -472,20 +472,22 @@ void Movies::init() {
|
||||
if (*((DWORD*)0x00518DA0) != 0x00503300) {
|
||||
dlog("Error: The value at address 0x001073A0 is not equal to 0x00503300.", DL_INIT);
|
||||
}
|
||||
|
||||
char optName[8] = "Movie";
|
||||
for (int i = 0; i < MaxMovies; i++) {
|
||||
MoviePtrs[i] = (DWORD)&MoviePaths[65 * i];
|
||||
MoviePaths[i * 65 + 64] = 0;
|
||||
char ininame[8];
|
||||
strcpy_s(ininame, "Movie");
|
||||
_itoa_s(i + 1, &ininame[5], 3, 10);
|
||||
int index = 65 * i;
|
||||
MoviePtrs[i] = (DWORD)&MoviePaths[index];
|
||||
MoviePaths[index + 64] = '\0';
|
||||
|
||||
_itoa_s(i + 1, &optName[5], 3, 10);
|
||||
if (i < 17) {
|
||||
GetConfigString("Misc", ininame, fo::var::movie_list[i], &MoviePaths[i * 65], 65);
|
||||
GetConfigString("Misc", optName, fo::var::movie_list[i], &MoviePaths[index], 65);
|
||||
} else {
|
||||
GetConfigString("Misc", ininame, "", &MoviePaths[i * 65], 65);
|
||||
GetConfigString("Misc", optName, "", &MoviePaths[index], 65);
|
||||
}
|
||||
}
|
||||
dlog(".", DL_INIT);
|
||||
SafeWriteBatch<DWORD>((DWORD)MoviePtrs, {0x44E6AE, 0x44E721, 0x44E75E, 0x44E78A});
|
||||
SafeWriteBatch<DWORD>((DWORD)MoviePtrs, {0x44E6AE, 0x44E721, 0x44E75E, 0x44E78A}); // gmovie_play_
|
||||
dlog(".", DL_INIT);
|
||||
|
||||
/*
|
||||
|
||||
+1
-8
@@ -1,15 +1,8 @@
|
||||
#include "main.h"
|
||||
#include "CheckAddress.h"
|
||||
#include "SafeWrite.h"
|
||||
|
||||
namespace sfall
|
||||
{
|
||||
|
||||
enum CodeType : BYTE {
|
||||
Call = 0xE8,
|
||||
Jump = 0xE9,
|
||||
Nop = 0x90
|
||||
};
|
||||
|
||||
static void __stdcall SafeWriteFunc(BYTE code, DWORD addr, void* func) {
|
||||
DWORD oldProtect, data = (DWORD)func - (addr + 5);
|
||||
|
||||
|
||||
@@ -7,6 +7,15 @@
|
||||
namespace sfall
|
||||
{
|
||||
|
||||
enum CodeType : BYTE {
|
||||
Call = 0xE8,
|
||||
Jump = 0xE9,
|
||||
Nop = 0x90,
|
||||
JumpShort = 0xEB, // 0xEB [jmp short ...]
|
||||
JumpNZ = 0x75, // 0x75 [jnz short ...]
|
||||
JumpZ = 0x74, // 0x74 [jz short ...]
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
void __stdcall SafeWrite(DWORD addr, T data) {
|
||||
DWORD oldProtect;
|
||||
|
||||
Reference in New Issue
Block a user