mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Changed the priority of files in AutoSearchPath
* now they have higher priority than the PatchFileXX options. Minor code edits/fixes.
This commit is contained in:
+3
-3
@@ -18,9 +18,9 @@ UseCommandLine=0
|
||||
;The greater numbers take precedence over lesser numbers
|
||||
;PatchFile0=mods\RP_data
|
||||
|
||||
;Path to the folder in which the game will automatically search and load custom .dat files
|
||||
;The data load order of the .dat files in the folder will be in reverse alphabetical order of the filenames
|
||||
;The .dat files specified in the PatchFileXX options will have higher priority than others
|
||||
;Path to the folder in which the game will automatically search and load custom files (by *.dat mask, including folders)
|
||||
;The data load order of the files in the folder will be in reverse alphabetical order of the filenames
|
||||
;The files placed in this folder will have higher priority than the PatchFileXX options
|
||||
;Uncomment the option to specify a different folder path. The default path is <GameRoot>\mods\
|
||||
;AutoSearchPath=mods
|
||||
|
||||
|
||||
@@ -265,16 +265,15 @@ fix: // check result
|
||||
|
||||
static void __declspec(naked) cai_perform_distance_prefs_hack() {
|
||||
__asm {
|
||||
push eax; // current distance to target
|
||||
mov ecx, eax; // current distance to target
|
||||
mov eax, esi;
|
||||
xor ebx, ebx; // no called shot
|
||||
mov edx, ATKTYPE_RWEAPON_PRIMARY;
|
||||
call fo::funcoffs::item_w_mp_cost_;
|
||||
mov edx, [esi + movePoints];
|
||||
sub edx, eax; // ap - cost = free AP's
|
||||
pop eax;
|
||||
jle moveAway; // <= 0
|
||||
lea edx, [edx + eax - 1];
|
||||
lea edx, [edx + ecx - 1];
|
||||
cmp edx, 5; // minimum threshold distance
|
||||
jge skipMove; // distance >= 5?
|
||||
moveAway:
|
||||
|
||||
@@ -44,7 +44,7 @@ static const DWORD bodypartAddr[] = {
|
||||
0x421656, 0x421675, // combat_safety_invalidate_weapon_func_
|
||||
0x421CC0, // combat_begin_extra_
|
||||
0x4229A9, // combat_turn_
|
||||
0x42330E, 0x4233AB, // shoot_along_path_
|
||||
0x42330E, 0x4233A6, 0x4233AB, // shoot_along_path_
|
||||
0x423E25, 0x423E2A, // compute_explosion_on_extras_
|
||||
0x425F83, // combat_anim_finished_
|
||||
0x42946D, // ai_best_weapon_
|
||||
|
||||
@@ -504,16 +504,17 @@ void Graphics::ShowMovieFrame() {
|
||||
d3d9Device->SetStreamSource(0, vBuffer2, 0, sizeof(VertexFormat));
|
||||
d3d9Device->SetRenderTarget(0, backbuffer);
|
||||
|
||||
if (Graphics::GPUBlt /*&& !ScriptShaders::Count()*/) {
|
||||
UINT unused;
|
||||
gpuBltEffect->Begin(&unused, 0);
|
||||
gpuBltEffect->BeginPass(0);
|
||||
}
|
||||
// TODO: The commented code sometimes for some unknown reason crashes the game when playing videos
|
||||
//if (Graphics::GPUBlt /*&& !ScriptShaders::Count()*/) {
|
||||
// UINT unused;
|
||||
// gpuBltEffect->Begin(&unused, 0);
|
||||
// gpuBltEffect->BeginPass(0);
|
||||
//}
|
||||
d3d9Device->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
|
||||
if (Graphics::GPUBlt /*&& !ScriptShaders::Count()*/) {
|
||||
gpuBltEffect->EndPass();
|
||||
gpuBltEffect->End();
|
||||
}
|
||||
//if (Graphics::GPUBlt /*&& !ScriptShaders::Count()*/) {
|
||||
// gpuBltEffect->EndPass();
|
||||
// gpuBltEffect->End();
|
||||
//}
|
||||
|
||||
// for movie
|
||||
d3d9Device->SetTexture(0, movieTex);
|
||||
@@ -956,6 +957,7 @@ public:
|
||||
ULONG _stdcall Release() { // called from game on exit
|
||||
if (!--Refs) {
|
||||
ScriptShaders::Release();
|
||||
|
||||
SAFERELEASE(backbuffer);
|
||||
SAFERELEASE(sSurf1);
|
||||
SAFERELEASE(sSurf2);
|
||||
@@ -969,6 +971,7 @@ public:
|
||||
SAFERELEASE(gpuPalette);
|
||||
SAFERELEASE(gpuBltEffect);
|
||||
SAFERELEASE(movieBuffer);
|
||||
|
||||
delete this;
|
||||
return 0;
|
||||
} else return Refs;
|
||||
|
||||
@@ -109,7 +109,7 @@ static fo::PathNode* __fastcall RemoveDatabase(const char* pathPatches) {
|
||||
while (paths) {
|
||||
if (_stricmp(paths->path, pathPatches) == 0) { // found path
|
||||
fo::PathNode* nextPaths = paths->next; // pointer to the node of the next path
|
||||
// TODO: need to check if this condition is used correctly
|
||||
// TODO: need to check if this condition is used correctly (everything seems to be in order here)
|
||||
if (paths != _paths)
|
||||
_paths->next = nextPaths; // replace the pointer in the previous node, removing the current(found) path from the chain
|
||||
else // if the current node is equal to the previous node
|
||||
@@ -204,7 +204,15 @@ static bool NormalizePath(std::string &path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Patches placed at the back of the vector will have priority in the chain over the front (previous) patches
|
||||
static void GetExtraPatches() {
|
||||
char patchFile[12] = "PatchFile";
|
||||
for (int i = 0; i < 100; i++) {
|
||||
_itoa(i, &patchFile[9], 10);
|
||||
auto patch = GetConfigString("ExtraPatches", patchFile, "", MAX_PATH);
|
||||
if (patch.empty() || !NormalizePath(patch) || GetFileAttributes(patch.c_str()) == INVALID_FILE_ATTRIBUTES) continue;
|
||||
patchFiles.push_back(patch);
|
||||
}
|
||||
std::string searchPath = GetConfigString("ExtraPatches", "AutoSearchPath", "mods\\", MAX_PATH);
|
||||
if (!searchPath.empty() && NormalizePath(searchPath)) {
|
||||
if (searchPath.back() != '\\') searchPath += "\\";
|
||||
@@ -223,13 +231,6 @@ static void GetExtraPatches() {
|
||||
FindClose(hFind);
|
||||
}
|
||||
}
|
||||
char patchFile[12] = "PatchFile";
|
||||
for (int i = 0; i < 100; i++) {
|
||||
_itoa(i, &patchFile[9], 10);
|
||||
auto patch = GetConfigString("ExtraPatches", patchFile, "", MAX_PATH);
|
||||
if (patch.empty() || !NormalizePath(patch) || GetFileAttributes(patch.c_str()) == INVALID_FILE_ATTRIBUTES) continue;
|
||||
patchFiles.push_back(patch);
|
||||
}
|
||||
// Remove first duplicates
|
||||
size_t size = patchFiles.size();
|
||||
for (size_t i = 1; i < size; ++i) {
|
||||
|
||||
@@ -299,33 +299,19 @@ static void AdditionalWeaponAnimsPatch() {
|
||||
static void SkilldexImagesPatch() {
|
||||
dlog("Checking for changed skilldex images.", DL_INIT);
|
||||
long tmp = GetConfigInt("Misc", "Lockpick", 293);
|
||||
if (tmp != 293) {
|
||||
SafeWrite32(0x518D54, tmp);
|
||||
}
|
||||
if (tmp != 293) SafeWrite32(0x518D54, tmp);
|
||||
tmp = GetConfigInt("Misc", "Steal", 293);
|
||||
if (tmp != 293) {
|
||||
SafeWrite32(0x518D58, tmp);
|
||||
}
|
||||
if (tmp != 293) SafeWrite32(0x518D58, tmp);
|
||||
tmp = GetConfigInt("Misc", "Traps", 293);
|
||||
if (tmp != 293) {
|
||||
SafeWrite32(0x518D5C, tmp);
|
||||
}
|
||||
if (tmp != 293) SafeWrite32(0x518D5C, tmp);
|
||||
tmp = GetConfigInt("Misc", "FirstAid", 293);
|
||||
if (tmp != 293) {
|
||||
SafeWrite32(0x518D4C, tmp);
|
||||
}
|
||||
if (tmp != 293) SafeWrite32(0x518D4C, tmp);
|
||||
tmp = GetConfigInt("Misc", "Doctor", 293);
|
||||
if (tmp != 293) {
|
||||
SafeWrite32(0x518D50, tmp);
|
||||
}
|
||||
if (tmp != 293) SafeWrite32(0x518D50, tmp);
|
||||
tmp = GetConfigInt("Misc", "Science", 293);
|
||||
if (tmp != 293) {
|
||||
SafeWrite32(0x518D60, tmp);
|
||||
}
|
||||
if (tmp != 293) SafeWrite32(0x518D60, tmp);
|
||||
tmp = GetConfigInt("Misc", "Repair", 293);
|
||||
if (tmp != 293) {
|
||||
SafeWrite32(0x518D64, tmp);
|
||||
}
|
||||
if (tmp != 293) SafeWrite32(0x518D64, tmp);
|
||||
dlogr(" Done", DL_INIT);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user