Merge branch 'develop' of https://github.com/phobos2077/sfall into develop

This commit is contained in:
phobos2077
2017-03-13 22:15:16 +07:00
3 changed files with 91 additions and 3 deletions
+1
View File
@@ -17,6 +17,7 @@
#define FO_VAR_btable 0x59E944
#define FO_VAR_btncnt 0x43EA1C
#define FO_VAR_CarCurrArea 0x672E68
#define FO_VAR_character_points 0x518538
#define FO_VAR_cmap 0x51DF34
#define FO_VAR_colorTable 0x6A38D0
#define FO_VAR_combat_free_move 0x56D39C
+89 -3
View File
@@ -323,6 +323,70 @@ skip:
jmp fo::funcoffs::item_get_type_
}
}
static void __declspec(naked) is_supper_bonus_hack() {
__asm {
add eax, ecx
test eax, eax
jle skip
cmp eax, 10
jle end
skip:
pop eax // Destroy the return address
xor eax, eax
inc eax
pop edx
pop ecx
pop ebx
end:
retn
}
}
static void __declspec(naked) PrintBasicStat_hack() {
__asm {
test eax, eax
jle skip
cmp eax, 10
jg end
pop ebx // Destroy the return address
push 0x434C21
retn
skip:
xor eax, eax
end:
retn
}
}
static void __declspec(naked) StatButtonUp_hook() {
__asm {
call fo::funcoffs::inc_stat_
test eax, eax
jl end
test ebx, ebx
jge end
sub ds:[FO_VAR_character_points], esi
dec esi
mov [esp+0xC+0x4], esi
end:
retn
}
}
static void __declspec(naked) StatButtonDown_hook() {
__asm {
call fo::funcoffs::stat_level_
cmp eax, 1
jg end
pop eax // Destroy the return address
xor eax, eax
inc eax
mov [esp+0xC], eax
push 0x437B41
end:
retn
}
}
static void __declspec(naked) loot_container_hack() {
__asm {
@@ -600,7 +664,7 @@ static void __declspec(naked) set_new_results_hack() {
inc edx // type = knockout
jmp fo::funcoffs::queue_remove_this_ // Remove knockout from queue (if there is one)
end:
pop eax // Destroying return address
pop eax // Destroy the return address
push 0x424FC6
retn
}
@@ -944,11 +1008,20 @@ end:
}
}
static void __declspec(naked) Save_as_ASCII_hack() {
__asm {
mov edx, STAT_sequence;
mov ebx, 626; // line index in EDITOR.MSG
push 0x4396FC; // call stat_level_
retn;
}
}
void BugFixes::init()
{
//if (GetConfigInt("Misc", "SharpshooterFix", 1)) {
dlog("Applying sharpshooter patch.", DL_INIT);
dlog("Applying Sharpshooter patch.", DL_INIT);
// http://www.nma-fallout.com/threads/fo2-engine-tweaks-sfall.178390/page-119#post-4050162
// by Slider2k
HookCall(0x4244AB, &SharpShooterFix); // hooks stat_level_() call in detemine_to_hit_func_()
@@ -1025,6 +1098,14 @@ void BugFixes::init()
SafeWrite8(0x4AC377, 0x7F); // jg
dlogr(" Done", DL_INIT);
// Fix for negative SPECIAL values in character creation
dlog("Applying fix for negative SPECIAL values in character creation.", DL_INIT);
MakeCall(0x43DF6F, &is_supper_bonus_hack, false);
MakeCall(0x434BFF, &PrintBasicStat_hack, false);
HookCall(0x437AB4, &StatButtonUp_hook);
HookCall(0x437B26, &StatButtonDown_hook);
dlogr(" Done", DL_INIT);
// Fix for not counting in the weight of equipped items on NPC when stealing or bartering
//if (GetConfigInt("Misc", "NPCWeightFix", 1)) {
dlog("Applying fix for not counting in weight of equipped items on NPC.", DL_INIT);
@@ -1060,7 +1141,7 @@ void BugFixes::init()
//}
//if (GetConfigInt("Misc", "BlackSkilldexFix", 1)) {
dlog("Applying black skilldex patch.", DL_INIT);
dlog("Applying black Skilldex patch.", DL_INIT);
HookCall(0x497D0F, &PipStatus_AddHotLines_hook);
dlogr(" Done", DL_INIT);
//}
@@ -1189,6 +1270,7 @@ void BugFixes::init()
//}
//if (GetConfigInt("Misc", "BagBackpackFix", 1)) {
dlog("Applying fix for bag/backpack bugs.", DL_INIT);
// Fix for items disappearing from inventory when you try to drag them to bag/backpack in the inventory list
// and are overloaded
HookCall(0x4764FC, (void*)fo::funcoffs::item_add_force_);
@@ -1203,10 +1285,14 @@ void BugFixes::init()
SafeWrite8(0x471C1C, 0x90); // nop
// Fix crash when trying to open bag/backpack on the table in the bartering interface
MakeCall(0x473191, &inven_action_cursor_hack, false);
dlogr(" Done", DL_INIT);
//}
// Fix crash when clicking on empty space in the inventory list opened by "Use Inventory Item On" (backpack) action icon
MakeCall(0x471A94, &use_inventory_on_hack, false);
// Fix for Sequence stat value not being printed correctly when using "print to file" option
MakeCall(0x4396F5, &Save_as_ASCII_hack, true);
}
}
+1
View File
@@ -68,6 +68,7 @@ static const char* ExtraLines[] = {
"Continuum",
"Fakeman",
"Drobovik",
"Mr.Stalin",
"Anyone who has used sfall in their own mods",
"The bug reporters and feature requesters",
""