Fixed PM's weapon being misplaced after level up

This commit is contained in:
NovaRain
2019-10-30 21:13:46 +08:00
parent 0d023c32db
commit c348925c95
2 changed files with 11 additions and 5 deletions
+1 -5
View File
@@ -10,10 +10,7 @@ namespace sfall
std::multimap<long, long> writeAddress;
static std::vector<long> excludeAddr = {
0x42a14f,
0x42a178,
//0x43C77D, // for 0x43C77C
0x42a14f, 0x42a178,
};
struct HackPair {
@@ -73,7 +70,6 @@ static std::vector<HackPair> hackAddr = {
{0x484B18, 1}, {0x484B19, 4}, // hookcall
// module: Movies
{0x44E937, 1}, {0x44E938, 4}, {0x44E949, 1}, {0x44E94A, 4}, // hookcalls
//{0x4A378B, 5}, {0x4A36EC, 4}, {0x4A3747, 4}, {0x4A376A, 4},
// module: Objects
{0x4A364A, 5}, {0x4831D9, 1}, {0x4831DA, 1},
{0x4841D6, 1}, {0x4841D7, 4}, // hookcall
+10
View File
@@ -2415,6 +2415,13 @@ end:
}
}
static void __declspec(naked) partyMemberCopyLevelInfo_hook_wield() {
__asm {
inc ebx; // slot
jmp fo::funcoffs::invenWieldFunc_;
}
}
void BugFixes::init()
{
#ifndef NDEBUG
@@ -3044,6 +3051,9 @@ void BugFixes::init()
// Note: pass negative amount values to critter_rm_trait to remove all ranks of the perk (vanilla behavior)
HookCall(0x458CDB, op_critter_rm_trait_hook);
HookCall(0x458B3D, op_critter_add_trait_hook);
// Fix for party member's equipped weapon being placed in the incorrect item slot after leveling up
HookCall(0x495FDF, partyMemberCopyLevelInfo_hook_wield);
}
}