mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Moved RemoveCriticalTimelimits to Criticals.cpp.
This commit is contained in:
+24
-6
@@ -57,7 +57,9 @@ struct CritStruct {
|
|||||||
static CritStruct* baseCritTable; // Base critical table set up via enabling OverrideCriticalTable in ddraw.ini
|
static CritStruct* baseCritTable; // Base critical table set up via enabling OverrideCriticalTable in ddraw.ini
|
||||||
static CritStruct* critTable;
|
static CritStruct* critTable;
|
||||||
static CritStruct* playerCrit;
|
static CritStruct* playerCrit;
|
||||||
|
|
||||||
static bool Inited = false;
|
static bool Inited = false;
|
||||||
|
|
||||||
static const char* errorTable = "\nError: %s - function requires enabling OverrideCriticalTable in ddraw.ini.";
|
static const char* errorTable = "\nError: %s - function requires enabling OverrideCriticalTable in ddraw.ini.";
|
||||||
|
|
||||||
void SetCriticalTable(DWORD critter, DWORD bodypart, DWORD slot, DWORD element, DWORD value) {
|
void SetCriticalTable(DWORD critter, DWORD bodypart, DWORD slot, DWORD element, DWORD value) {
|
||||||
@@ -145,12 +147,7 @@ void CritLoad() {
|
|||||||
|
|
||||||
#define SetEntry(critter, bodypart, effect, param, value) defaultTable[critter * 9 * 6 + bodypart * 6 + effect].values[param] = value;
|
#define SetEntry(critter, bodypart, effect, param, value) defaultTable[critter * 9 * 6 + bodypart * 6 + effect].values[param] = value;
|
||||||
|
|
||||||
void CritInit() {
|
static void CriticalTableOverride() {
|
||||||
mode = GetPrivateProfileIntA("Misc", "OverrideCriticalTable", 2, ini);
|
|
||||||
if (mode < 0 || mode > 3) mode = 0;
|
|
||||||
|
|
||||||
if (!mode) return;
|
|
||||||
|
|
||||||
dlog("Initializing critical table override.", DL_INIT);
|
dlog("Initializing critical table override.", DL_INIT);
|
||||||
baseCritTable = new CritStruct[CritTableSize]();
|
baseCritTable = new CritStruct[CritTableSize]();
|
||||||
critTable = new CritStruct[CritTableSize];
|
critTable = new CritStruct[CritTableSize];
|
||||||
@@ -260,3 +257,24 @@ void CritInit() {
|
|||||||
Inited = true;
|
Inited = true;
|
||||||
dlogr(" Done", DL_INIT);
|
dlogr(" Done", DL_INIT);
|
||||||
}
|
}
|
||||||
|
#undef SetEntry
|
||||||
|
|
||||||
|
static void RemoveCriticalTimeLimitsPatch() {
|
||||||
|
if (GetPrivateProfileIntA("Misc", "RemoveCriticalTimelimits", 0, ini)) {
|
||||||
|
dlog("Removing critical time limits.", DL_INIT);
|
||||||
|
SafeWrite8(0x424118, 0xEB); // jump to 0x424131
|
||||||
|
SafeWrite8(0x4A3053, 0x0);
|
||||||
|
SafeWrite8(0x4A3094, 0x0);
|
||||||
|
dlogr(" Done", DL_INIT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CritInit() {
|
||||||
|
mode = GetPrivateProfileIntA("Misc", "OverrideCriticalTable", 2, ini);
|
||||||
|
if (mode < 0 || mode > 3) mode = 0;
|
||||||
|
if (mode) {
|
||||||
|
CriticalTableOverride();
|
||||||
|
}
|
||||||
|
|
||||||
|
RemoveCriticalTimeLimitsPatch();
|
||||||
|
}
|
||||||
|
|||||||
@@ -1336,14 +1336,6 @@ static void DllMain2() {
|
|||||||
|
|
||||||
AnimationsAtOnceInit();
|
AnimationsAtOnceInit();
|
||||||
|
|
||||||
if (GetPrivateProfileIntA("Misc", "RemoveCriticalTimelimits", 0, ini)) {
|
|
||||||
dlog("Removing critical time limits.", DL_INIT);
|
|
||||||
SafeWrite8(0x424118, 0xEB); // jmps 0x424131
|
|
||||||
SafeWrite8(0x4A3053, 0x0);
|
|
||||||
SafeWrite8(0x4A3094, 0x0);
|
|
||||||
dlogr(" Done", DL_INIT);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tmp = GetPrivateProfileIntA("Sound", "OverrideMusicDir", 0, ini)) {
|
if (tmp = GetPrivateProfileIntA("Sound", "OverrideMusicDir", 0, ini)) {
|
||||||
SafeWrite32(0x4449C2, (DWORD)musicOverridePath);
|
SafeWrite32(0x4449C2, (DWORD)musicOverridePath);
|
||||||
SafeWrite32(0x4449DB, (DWORD)musicOverridePath);
|
SafeWrite32(0x4449DB, (DWORD)musicOverridePath);
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <hash_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|||||||
Reference in New Issue
Block a user