mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Tweaked the code of the fix in previous commit.
This commit is contained in:
+4
-3
@@ -1872,10 +1872,11 @@ static void __declspec(naked) JesseContainerFid() {
|
|||||||
static void __declspec(naked) ai_search_inven_weap_hook() {
|
static void __declspec(naked) ai_search_inven_weap_hook() {
|
||||||
__asm {
|
__asm {
|
||||||
call item_w_subtype_;
|
call item_w_subtype_;
|
||||||
cmp eax, 2; // check if subtype <= MELEE
|
cmp eax, 3; // check subtype == THROWING
|
||||||
jbe fix;
|
jne fix;
|
||||||
retn;
|
retn;
|
||||||
fix:
|
fix:
|
||||||
|
xor eax, eax;
|
||||||
mov edx, [esi + 0x40];
|
mov edx, [esi + 0x40];
|
||||||
test edx, edx;
|
test edx, edx;
|
||||||
js skip;
|
js skip;
|
||||||
@@ -2385,6 +2386,6 @@ void BugsInit()
|
|||||||
|
|
||||||
// Fix for NPC stuck in a loop of reloading melee/unarmed weapons when out of ammo
|
// Fix for NPC stuck in a loop of reloading melee/unarmed weapons when out of ammo
|
||||||
dlog("Applying fix for NPC stuck in a loop of reloading melee/unarmed weapons.", DL_INIT);
|
dlog("Applying fix for NPC stuck in a loop of reloading melee/unarmed weapons.", DL_INIT);
|
||||||
HookCall(0x429A2B , ai_search_inven_weap_hook);
|
HookCall(0x429A2B, ai_search_inven_weap_hook);
|
||||||
dlogr(" Done", DL_INIT);
|
dlogr(" Done", DL_INIT);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user