Mercurial > mm7
changeset 475:77430756f06a
fix show info item in shop
author | Gloval |
---|---|
date | Tue, 26 Feb 2013 08:47:23 +0400 |
parents | 442afd6c34a4 |
children | 89f6107c3362 |
files | Items.cpp mm7_2.cpp mm7_4.cpp mm7_data.h |
diffstat | 4 files changed, 47 insertions(+), 44 deletions(-) [+] |
line wrap: on
line diff
--- a/Items.cpp Tue Feb 26 07:40:26 2013 +0400 +++ b/Items.cpp Tue Feb 26 08:47:23 2013 +0400 @@ -130,6 +130,7 @@ unsigned __int16 shopMagicSpc_treasure_lvl[14] = {0, 2, 2, 3, 3, 5, 5, 4, 3, 3, 3, 3, 3, 3}; unsigned __int16 shopAlchSpc_treasure_lvl[13] = {0, 2, 2, 3, 3, 4, 4, 5, 5, 3, 2, 2, 2}; +int sub_4BE571(int a1, int *a2, int a3, int a4); ItemGen *ptr_50C9A4; @@ -2377,3 +2378,32 @@ pDialogueWindow->_41D08F(i, 1, 0, 2); dword_F8B1E0 = pDialogueWindow->pNumPresenceButton; } + + //----- (004BE571) -------------------------------------------------------- +int sub_4BE571(int a1, int *a2, int a3, int a4) + { + int result; // eax@1 + int i; // esi@3 + + result = a3; + if ( a3 < a4 ) + { + for ( i = 0; i < a3; ++i ) + { + if ( a1 == a2[i] ) + break; + } + if ( i == a3 ) + { + a2[a3] = a1; + result = a3 + 1; + } + return result; + } + else + { + return a4; + } + } + +
--- a/mm7_2.cpp Tue Feb 26 07:40:26 2013 +0400 +++ b/mm7_2.cpp Tue Feb 26 08:47:23 2013 +0400 @@ -2781,9 +2781,9 @@ v75 = (int)window_SpeakInHouse->ptr_1C; v76 = 9 * (v74 - 1 + 12 * v75); if ( dword_F8B19C == 2 ) - v77 = (ItemGen *)&pParty->StandartItemsInShops[v76]; + v77 = (ItemGen *)&pParty->StandartItemsInShops[(int)75][v74-1]; else - v77 = &pParty->SpecialItemsInShops[(int)75][v74-1];//(ItemGen *)&pParty->field_C59C[v76 + 724]; + v77 = &pParty->SpecialItemsInShops[(int)v75][v74-1];//(ItemGen *)&pParty->field_C59C[v76 + 724]; if ( v69 == (short)v11 || Str == v11 ) { v124 = (__int64 *)v11; @@ -4997,33 +4997,6 @@ } // F8B5E8: using guessed type FrameTableTxtLine stru_F8B5E8; -//----- (004BE571) -------------------------------------------------------- -int __fastcall sub_4BE571(int a1, int *a2, int a3, int a4) -{ - int result; // eax@1 - int i; // esi@3 - - result = a3; - if ( a3 < a4 ) - { - for ( i = 0; i < a3; ++i ) - { - if ( a1 == a2[i] ) - break; - } - if ( i == a3 ) - { - a2[a3] = a1; - result = a3 + 1; - } - } - else - { - result = a4; - } - return result; -} - //----- (004BF91E) --------------------------------------------------------
--- a/mm7_4.cpp Tue Feb 26 07:40:26 2013 +0400 +++ b/mm7_4.cpp Tue Feb 26 08:47:23 2013 +0400 @@ -9069,13 +9069,13 @@ ItemGen *v7; // ecx@13 signed int v8; // esi@17 unsigned int v9; // eax@19 - char v10; // [sp+8h] [bp-44h]@12 - char v11; // [sp+10h] [bp-3Ch]@12 - char v12; // [sp+18h] [bp-34h]@18 - char v13; // [sp+20h] [bp-2Ch]@17 - char v14; // [sp+28h] [bp-24h]@17 - char v15; // [sp+30h] [bp-1Ch]@17 - char v16; // [sp+38h] [bp-14h]@5 + POINT v10; // [sp+8h] [bp-44h]@12 + POINT v11; // [sp+10h] [bp-3Ch]@12 + POINT v12; // [sp+18h] [bp-34h]@18 + POINT v13; // [sp+20h] [bp-2Ch]@17 + POINT v14; // [sp+28h] [bp-24h]@17 + POINT v15; // [sp+30h] [bp-1Ch]@17 + POINT v16; // [sp+38h] [bp-14h]@5 POINT a2; // [sp+40h] [bp-Ch]@5 int v18; // [sp+48h] [bp-4h]@5 @@ -9090,10 +9090,10 @@ return; if ( dword_F8B19C <= 5 || dword_F8B19C == 94 ) { - v8 = pMouse->GetCursorPos((POINT *)&v15)->x - 14; - v18 = (v8 >> 5) + 14 * ((pMouse->GetCursorPos((POINT *)&v14)->y - 17) >> 5); - if ( pMouse->GetCursorPos((POINT *)&v13)->x <= 13 - || pMouse->GetCursorPos((POINT *)&v12)->x >= 462 + v8 = pMouse->GetCursorPos(&v15)->x - 14; + v18 = (v8 >> 5) + 14 * ((pMouse->GetCursorPos(&v14)->y - 17) >> 5); + if ( pMouse->GetCursorPos(&v13)->x <= 13 + || pMouse->GetCursorPos(&v12)->x >= 462 || (v9 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex(&v18)) == 0 ) return; v7 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v9-1]; @@ -9104,8 +9104,8 @@ if ( dword_F8B19C != 95 ) return; } - v4 = pMouse->GetCursorPos((POINT *)&v11); - v5 = pRenderer->pActiveZBuffer[v4->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v10)->y]] & 0xFFFF; + v4 = pMouse->GetCursorPos(&v11); + v5 = pRenderer->pActiveZBuffer[v4->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v10)->y]] & 0xFFFF; v18 = v5; if ( !v5 ) return; @@ -9119,7 +9119,7 @@ if ( in_current_bilding_type <= 16 && dword_F8B19C == 18 ) { v1 = pMouse->GetCursorPos(&a2); - v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v16)->y]; + v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v16)->y]; v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; v18 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; if ( v18 )
--- a/mm7_data.h Tue Feb 26 07:40:26 2013 +0400 +++ b/mm7_data.h Tue Feb 26 08:47:23 2013 +0400 @@ -2347,7 +2347,7 @@ void __cdecl sub_4BDB56_buy_skill____(); struct FrameTableTxtLine *__thiscall texture_frame_table_txt_parser(const char *_this, FrameTableTxtLine *a2); struct FrameTableTxtLine *__thiscall frame_table_txt_parser(const char *pString, FrameTableTxtLine *a2); -int __fastcall sub_4BE571(int a1, int *a2, int a3, int a4); + void __cdecl ShowIntroVideo_and_LoadingScreen(); unsigned int __thiscall GameOverMenu(void *ecx0); bool __thiscall BinkLockBuffer(struct _BINKBUF *_this);