Fix build after merging changes from 3.8 branch.

This commit is contained in:
phobos2077
2017-02-22 02:08:59 +07:00
parent 214e405c32
commit a69b1b92b2
2 changed files with 14 additions and 14 deletions
+9 -9
View File
@@ -859,7 +859,7 @@ end:
static void __declspec(naked) switch_hand_hack() { static void __declspec(naked) switch_hand_hack() {
__asm { __asm {
mov eax, ds:[_inven_dude] mov eax, ds:[VARPTR_inven_dude]
push eax push eax
mov [edi], ebp mov [edi], ebp
inc ecx inc ecx
@@ -867,11 +867,11 @@ static void __declspec(naked) switch_hand_hack() {
xor ebx, ebx xor ebx, ebx
inc ebx inc ebx
mov edx, ebp mov edx, ebp
call item_remove_mult_ call FuncOffs::item_remove_mult_
skip: skip:
pop edx pop edx
mov eax, ebp mov eax, ebp
call item_get_type_ call FuncOffs::item_get_type_
cmp eax, item_type_container cmp eax, item_type_container
jne end jne end
mov [ebp+0x7C], edx // iobj.owner = _inven_dude mov [ebp+0x7C], edx // iobj.owner = _inven_dude
@@ -885,7 +885,7 @@ end:
static void __declspec(naked) inven_item_wearing() { static void __declspec(naked) inven_item_wearing() {
__asm { __asm {
mov esi, ds:[_inven_dude] mov esi, ds:[VARPTR_inven_dude]
xchg ebx, eax // ebx = source xchg ebx, eax // ebx = source
mov eax, [esi+0x20] mov eax, [esi+0x20]
and eax, 0xF000000 and eax, 0xF000000
@@ -893,11 +893,11 @@ static void __declspec(naked) inven_item_wearing() {
test eax, eax // check if object FID type flag is set to item test eax, eax // check if object FID type flag is set to item
jnz skip // No jnz skip // No
mov eax, esi mov eax, esi
call item_get_type_ call FuncOffs::item_get_type_
cmp eax, item_type_container // Bag/Backpack? cmp eax, item_type_container // Bag/Backpack?
jne skip // No jne skip // No
mov eax, esi mov eax, esi
call obj_top_environment_ call FuncOffs::obj_top_environment_
test eax, eax // has an owner? test eax, eax // has an owner?
jz skip // No jz skip // No
mov ecx, [eax+0x20] mov ecx, [eax+0x20]
@@ -919,9 +919,9 @@ static void __declspec(naked) inven_action_cursor_hack() {
__asm { __asm {
cmp dword ptr [esp+0x44+0x4], item_type_container cmp dword ptr [esp+0x44+0x4], item_type_container
jne end jne end
cmp eax, ds:[_stack] cmp eax, ds:[VARPTR_stack]
je end je end
cmp eax, ds:[_target_stack] cmp eax, ds:[VARPTR_target_stack]
end: end:
retn retn
} }
@@ -1174,7 +1174,7 @@ void BugsInit()
//if (GetPrivateProfileIntA("Misc", "BagBackpackFix", 1, ini)) { //if (GetPrivateProfileIntA("Misc", "BagBackpackFix", 1, ini)) {
// Fix for items disappearing from inventory when you try to drag them to bag/backpack in the inventory list // Fix for items disappearing from inventory when you try to drag them to bag/backpack in the inventory list
// and are overloaded // and are overloaded
HookCall(0x4764FC, (void*)item_add_force_); HookCall(0x4764FC, (void*)FuncOffs::item_add_force_);
// Fix for the engine not checking player's inventory properly when putting items into the bag/backpack in the hands // Fix for the engine not checking player's inventory properly when putting items into the bag/backpack in the hands
MakeCall(0x4715DB, &switch_hand_hack, true); MakeCall(0x4715DB, &switch_hand_hack, true);
// Fix to ignore player's equipped items when opening bag/backpack // Fix to ignore player's equipped items when opening bag/backpack
+5 -5
View File
@@ -592,8 +592,8 @@ static void __declspec(naked) item_add_mult_hook() {
static void __declspec(naked) inven_pickup_hook() { static void __declspec(naked) inven_pickup_hook() {
__asm { __asm {
mov eax, ds:[_i_wid] mov eax, ds:[VARPTR_i_wid]
call GNW_find_ call FuncOffs::GNW_find_
mov ebx, [eax+0x8+0x0] // ebx = _i_wid.rect.x mov ebx, [eax+0x8+0x0] // ebx = _i_wid.rect.x
mov ecx, [eax+0x8+0x4] // ecx = _i_wid.rect.y mov ecx, [eax+0x8+0x4] // ecx = _i_wid.rect.y
mov eax, 176 mov eax, 176
@@ -602,10 +602,10 @@ static void __declspec(naked) inven_pickup_hook() {
mov edx, 37 mov edx, 37
add edx, ecx // y_start add edx, ecx // y_start
add ecx, 37+100 // y_end add ecx, 37+100 // y_end
call mouse_click_in_ call FuncOffs::mouse_click_in_
test eax, eax test eax, eax
jz end jz end
mov edx, ds:[_curr_stack] mov edx, ds:[VARPTR_curr_stack]
test edx, edx test edx, edx
jnz end jnz end
cmp edi, 1006 // Hands? cmp edi, 1006 // Hands?
@@ -686,7 +686,7 @@ void InventoryInit() {
HookCall(0x471457, &inven_pickup_hook); HookCall(0x471457, &inven_pickup_hook);
// Move items to player's main inventory instead of the opened bag/backpack when confirming a trade // Move items to player's main inventory instead of the opened bag/backpack when confirming a trade
SafeWrite32(0x475CF2, _stack); SafeWrite32(0x475CF2, VARPTR_stack);
} }
void InventoryReset() { void InventoryReset() {