diff --git a/sfall/HRP/InterfaceBar.cpp b/sfall/HRP/InterfaceBar.cpp index 0d3754ff4..9e12d1d0d 100644 --- a/sfall/HRP/InterfaceBar.cpp +++ b/sfall/HRP/InterfaceBar.cpp @@ -396,7 +396,7 @@ static void GetAmmoMetreColors(long yPercent, BYTE &outClr1, BYTE &outClr2) { static void __fastcall DrawAlternateAmmoMetre(long x, long y) { fo::Window* win = fo::func::GNW_find(fo::var::interfaceWindow); - x += xOffset - 2; + x += xOffset + 1; long startOffset = x + (25 * win->width); BYTE* surface = win->surface + startOffset; @@ -452,7 +452,7 @@ static void __fastcall DrawAlternateAmmoMetre(long x, long y) { fo::BoundRect rect; rect.x = x; rect.y = 26; - rect.offx = x + 3; + rect.offx = x + 4; rect.offy = 26 + 70; fo::func::win_draw_rect(fo::var::interfaceWindow, (RECT*)&rect); diff --git a/sfall/Modules/BugFixes.cpp b/sfall/Modules/BugFixes.cpp index 31436d2ee..0d87d87c7 100644 --- a/sfall/Modules/BugFixes.cpp +++ b/sfall/Modules/BugFixes.cpp @@ -3313,7 +3313,7 @@ void BugFixes::init() { SafeWrite8(0x424527, CodeType::JumpShort); // in detemine_to_hit_func_() //} - // Fixes for clickability issue in Pip-Boy and exploit that allows to rest in places where you shouldn't be able to rest + // Fixes for clickability issue in Pip-Boy and exploit that allows resting in places where you shouldn't be able to dlogr("Applying fix for Pip-Boy clickability issues and rest exploit.", DL_FIX); MakeCall(0x4971C7, pipboy_hack); MakeCall(0x499530, PipAlarm_hack); diff --git a/sfall/Modules/Interface.cpp b/sfall/Modules/Interface.cpp index 1dab39087..4ce5c956b 100644 --- a/sfall/Modules/Interface.cpp +++ b/sfall/Modules/Interface.cpp @@ -992,12 +992,14 @@ static void __declspec(naked) gmouse_bk_process_hook() { } } +static long ammoBarXPos = 461; // move ammo bar away from rivets (was 463) + static void __declspec(naked) intface_update_ammo_lights_hack() { __asm { mov eax, 70; // 70 - full ammo bar cmp edx, eax; cmovg edx, eax; - mov eax, 463; // overwritten engine code + mov eax, ammoBarXPos; // overwritten engine code retn; } } @@ -1100,6 +1102,13 @@ void Interface::init() { // Fix crash when the player equips a weapon overloaded with ammo (ammo bar overflow) MakeCall(0x45F94F, intface_update_ammo_lights_hack); + // Tweak for ammo bar position with HRP by Mash + if (HRP::Setting::ExternalEnabled()) { + ammoBarXPos = 465; + if (IniReader::GetInt("IFACE", "ALTERNATE_AMMO_METRE", 0, ".\\f2_res.ini")) { + ammoBarXPos -= 2; + } + } } void Interface::exit() {