Mercurial > mm7
diff Player.cpp @ 1014:a704435d3285
comtinue player cleaning
author | Gloval |
---|---|
date | Sun, 19 May 2013 20:38:49 +0400 |
parents | 9e823ad5eaa6 |
children | 9ac94d00012e 32ec62bbaa2c |
line wrap: on
line diff
--- a/Player.cpp Sun May 19 12:13:42 2013 +0400 +++ b/Player.cpp Sun May 19 20:38:49 2013 +0400 @@ -222,27 +222,21 @@ //----- (004BE2DD) -------------------------------------------------------- -void Player::SalesProcess(unsigned int a2, int a3, int _2devent_idx) -{ - Player *v4; // edi@1 - char *v5; // esi@1 +void Player::SalesProcess( unsigned int inventory_idnx, int item_index, int _2devent_idx ) + { float v6; // ST04_4@1 - signed int v7; // eax@1 - signed int v8; // ebx@1 - - auto a4 = _2devent_idx; - v4 = this; - v5 = (char *)this + 36 * a3; - v6 = p2DEvents[a4 - 1].fPriceMultiplier; - //v6 = p2DEvents_minus1__20[13 * a4]; - v7 = ((ItemGen *)(v5 + 532))->GetValue(); - v8 = GetPriceSell(v7, v6); - if ( v5[552] & 2 ) - v8 = 1; - if ( v8 < 1 ) - v8 = 1; - RemoveItemAtInventoryIndex(a2); - Party::SetGold(pParty->uNumGold + v8); + signed int item_value; // eax@1 + signed int sell_price; // ebx@1 + + item_value =pOwnItems[item_index].GetValue(); + v6 = p2DEvents[ _2devent_idx - 1].fPriceMultiplier; + sell_price = GetPriceSell(item_value, v6); + if ( pOwnItems[item_index].Broken() ) + sell_price = 1; + if ( sell_price < 1 ) + sell_price = 1; + RemoveItemAtInventoryIndex(inventory_idnx); + Party::SetGold(pParty->uNumGold + sell_price); } @@ -250,35 +244,21 @@ //----- (0043EEF3) -------------------------------------------------------- bool Player::_43EEF3() { - signed int v1; // esi@1 - PlayerEquipment *v2; // edx@1 - bool result; // eax@2 - - v1 = 0; - v2 = &this->pEquipment; - while ( 1 ) - { - result = v2->uShield; - if ( v2->uShield ) - { - result = *(int *)&this->pInventoryItems[result-1]; - if ( result ) - { - if ( result != 64 && result != 65 ) - break; - } - } - ++v1; - v2 = (PlayerEquipment *)((char *)v2 + 4); - if ( v1 >= 16 ) - { - LOBYTE(result) = 1; - return result; - } - } - LOBYTE(result) = 0; - return result; -} + signed int item_idx; // esi@1 + signed int item_id; // esi@1 + for (int i=0; i<16;++i) + { + item_idx=pEquipment.pIndices[i]; + if (item_idx) + { + item_id=pOwnItems[item_idx-1].uItemID; + if (item_id!=64 && item_id!= 65 ) //blaster& blaster rifle + return false; + } + } + return true; + } + @@ -458,7 +438,7 @@ v1 = this; v2 = (signed int)window_SpeakInHouse->ptr_1C; - if ( v2 == 78 || v2 > 80 && v2 <= 82 ) + if ( (v2 == 78 || v2 > 80) && v2 <= 82 ) { if ( GetMajorConditionIdx() == 18 ) goto LABEL_6; @@ -669,7 +649,7 @@ { if ( v3 > 11 ) { - if ( v3 == CHARACTER_EXPRESSION_PERTIFIED || v3 > 97 && v3 <= 99 ) + if ( v3 == CHARACTER_EXPRESSION_PERTIFIED ||( v3 > 97 && v3 <= 99) ) return; goto LABEL_15; } @@ -1073,259 +1053,220 @@ //----- (00492D65) -------------------------------------------------------- int Player::SetCondition(unsigned int uConditionIdx, int a3) -{ - Player *v3; // esi@1 - Player **v4; // ebx@2 - Player *v5; // ecx@21 - Player *v6; // ecx@22 - Player *v7; // ecx@29 - Player *v8; // ecx@29 - - Player *v11; // ecx@45 - Player *v12; // ecx@46 - char *v13; // eax@49 - Player *v14; // ecx@58 - Player *v15; // ecx@59 - Player *v16; // ecx@60 - signed int result; // eax@76 - signed int v18; // ecx@77 - int v19; // eax@77 - char v20; // al@80 - signed int v21; // ebx@82 - signed int v22; // esi@82 - int v23; // [sp-8h] [bp-1Ch]@7 - int v24; // [sp-8h] [bp-1Ch]@15 - int v25; // [sp-8h] [bp-1Ch]@53 - int v26; // [sp-4h] [bp-18h]@7 - signed int v27; // [sp-4h] [bp-18h]@15 - int v28; // [sp-4h] [bp-18h]@53 - char *v29; // [sp+Ch] [bp-8h]@1 - int v30; // [sp+10h] [bp-4h]@2 - int v31; // [sp+20h] [bp+Ch]@82 - - v3 = this; - v29 = (char *)this + 8 * uConditionIdx; - if ( *(_QWORD *)v29 ) - { -LABEL_76: - result = 0; - } - else - { - v4 = &pPlayers[1]; - v30 = 0; - do - { - if ( (*v4)->CanAct() ) - ++v30; - ++v4; - } - while ( (signed int)v4 <= (signed int)&pPlayers[4] ); + { + + signed int player_sex; // ecx@77 + char zombi_face; // al@80 + signed int remainig_player; // ebx@82 + int players_before; // [sp+10h] [bp-4h]@2 + int players_after; // [sp+20h] [bp+Ch]@82 + + if ( pConditions[uConditionIdx] ) + return 0; + players_before = 0; + for (int i=1;i<5;++i) + if ( pPlayers[i]->CanAct() ) + ++players_before; + switch ( uConditionIdx ) - { - case 0u: - v26 = 0; - v23 = 30; - goto LABEL_81; - case 1u: + { + case Condition_Cursed: + PlaySound((PlayerSpeech)30, 0); + break; + case Condition_Weak: if ( a3 == 1 && (signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0 ) - goto LABEL_10; - v26 = 0; - v23 = 25; - goto LABEL_81; - case 2u: - if ( a3 != 1 ) - goto LABEL_82; - if ( v3->HasEnchantedItemEquipped(22) ) - goto LABEL_76; - v27 = 3; - v24 = 505; - goto LABEL_16; - case 3u: - v26 = 0; - v23 = 26; - goto LABEL_81; - case 4u: - v26 = 0; - v23 = 31; - goto LABEL_81; - case 5u: + {--pParty->pPartyBuffs[13].uPower; + if ( pParty->pPartyBuffs[13].uPower < 1u ) + pParty->pPartyBuffs[13].Reset(); + return 0; + } + + PlaySound((PlayerSpeech)25, 0); + break; + case Condition_Sleep: + if ( a3 == 1 &&(HasEnchantedItemEquipped(22)||WearsItem(505, 3))) + return 0; + break; + + case Condition_Fear: + PlaySound((PlayerSpeech)26, 0); + break; + case Condition_Drunk: + PlaySound((PlayerSpeech)31, 0); + break; + + case Condition_Insane: if ( a3 == 1 - && (v3->HasEnchantedItemEquipped(19) || v5->WearsItem(505, 3) || v6->WearsItem(530, 6)) ) - goto LABEL_76; - v26 = 0; - v23 = 29; - goto LABEL_81; - case 6u: - case 8u: - case 0xAu: + && (HasEnchantedItemEquipped(19) || WearsItem(505, 3) || WearsItem(530, 6)) ) + return 0; + + PlaySound((PlayerSpeech)29, 0); + break; + case Condition_Poison1: + case Condition_Poison2: + case Condition_Poison3: + if ( a3 == 1 ) + { + if ( (signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0i64 ) + { + --pParty->pPartyBuffs[13].uPower; + if ( pParty->pPartyBuffs[13].uPower < 1u ) + pParty->pPartyBuffs[13].Reset(); + } + if ( HasEnchantedItemEquipped(21) + || WearsItem(505, 3) + || WearsItem(530, 6) ) + //goto LABEL_76; + return 0; + } + + //v23 = 27; + PlaySound((PlayerSpeech)27, 0); + break; + + case Condition_Disease1: + case Condition_Disease2: + case Condition_Disease3: if ( a3 == 1 ) - { - if ( (signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0 ) - { + { + if ( pParty->pPartyBuffs[13].uExpireTime > 0i64 ) + { + --pParty->pPartyBuffs[13].uPower; + if ( pParty->pPartyBuffs[13].uPower < 1u ) + pParty->pPartyBuffs[13].Reset(); + return 0; + } + + if ( HasEnchantedItemEquipped(18) ||WearsItem(505, 3) || WearsItem(530, 6) ) + return 0; + } + PlaySound((PlayerSpeech)28, 0); + break; + case Condition_Paralyzed: + if ( a3 == 1 ) + { + if ( pParty->pPartyBuffs[13].uExpireTime > 0i64 ) + { + --pParty->pPartyBuffs[13].uPower; + if ( pParty->pPartyBuffs[13].uPower < 1u ) + pParty->pPartyBuffs[13].Reset(); + return 0; + } + + if ( HasEnchantedItemEquipped(20)|| WearsItem(505, 3)|| WearsItem(507, 16)||WearsItem(530, 6)) + return 0; + } + break; + case Condition_Unconcious: + PlaySound(SPEECH_32, 0); + if ( sHealth > 0 ) + sHealth = 0; + break; + case Condition_Dead: + if ( a3 == 1 && (signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0i64 && pParty->pPartyBuffs[13].uSkill >= 4u ) + { --pParty->pPartyBuffs[13].uPower; if ( pParty->pPartyBuffs[13].uPower < 1u ) - pParty->pPartyBuffs[13].Reset(); - } - if ( v3->HasEnchantedItemEquipped(21) - || v7->WearsItem(505, 3) - || v8->WearsItem(530, 6) ) - goto LABEL_76; - } - v26 = 0; - v23 = 27; - goto LABEL_81; - case 7u: - case 9u: - case 0xBu: - if ( a3 != 1 ) - goto LABEL_40; - if ( SHIDWORD(pParty->pPartyBuffs[13].uExpireTime) >= 0 - && (SHIDWORD(pParty->pPartyBuffs[13].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[13].uExpireTime) > 0) ) - goto LABEL_10; - if ( v3->HasEnchantedItemEquipped(18) || v3->WearsItem(505, 3) || v3->WearsItem(530, 6) ) - goto LABEL_76; -LABEL_40: - v26 = 0; - v23 = 28; - goto LABEL_81; - case 0xCu: - if ( a3 != 1 ) - goto LABEL_82; - if ( SHIDWORD(pParty->pPartyBuffs[13].uExpireTime) >= 0 - && (SHIDWORD(pParty->pPartyBuffs[13].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[13].uExpireTime) > 0) ) - goto LABEL_10; - if ( v3->HasEnchantedItemEquipped(20) - || v11->WearsItem(505, 3) - || v12->WearsItem(507, 16) ) - goto LABEL_76; - v27 = 6; - v24 = 530; -LABEL_16: - if ( v3->WearsItem(v24, v27) ) - goto LABEL_76; - goto LABEL_82; - case 0xDu: - v3->PlaySound(SPEECH_32, 0); - v13 = (char *)&v3->sHealth; - goto LABEL_70; - case 0xEu: - if ( a3 == 1 && (signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0 && pParty->pPartyBuffs[13].uSkill >= 4u ) - goto LABEL_10; - v28 = 0; - v25 = 33; - goto LABEL_67; - case 0xFu: + pParty->pPartyBuffs[13].Reset(); + } + + PlaySound((PlayerSpeech)33, 0); + if ( sHealth > 0 ) + sHealth = 0; + if ( sMana > 0 ) + sMana = 0; + break; + case Condition_Pertified: if ( a3 == 1 - && (SHIDWORD(pParty->pPartyBuffs[13].uExpireTime) >= 0 - && (SHIDWORD(pParty->pPartyBuffs[13].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[13].uExpireTime) > 0) - || v3->HasEnchantedItemEquipped(23) - || v14->WearsItem(520, 16) - || v15->WearsItem(505, 3) - || v16->WearsItem(530, 6)) ) - goto LABEL_76; - v26 = 0; - v23 = 34; - goto LABEL_81; - case 0x10u: - if ( a3 == 1 && (signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0 && pParty->pPartyBuffs[13].uSkill >= 4u ) - { -LABEL_10: - --pParty->pPartyBuffs[13].uPower; - if ( pParty->pPartyBuffs[13].uPower < 1u ) - pParty->pPartyBuffs[13].Reset(); - goto LABEL_76; + &&((pParty->pPartyBuffs[13].uExpireTime > 0i64) + || HasEnchantedItemEquipped(23)|| WearsItem(520, 16) || WearsItem(505, 3) || WearsItem(530, 6)) ) + + return 0; + PlaySound((PlayerSpeech)34, 0); + break; + case Condition_Eradicated: + if ( a3 == 1 && ((signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0 )&&( pParty->pPartyBuffs[13].uSkill >= 4u )) + { + --pParty->pPartyBuffs[13].uPower; + if ( pParty->pPartyBuffs[13].uPower < 1u ) + pParty->pPartyBuffs[13].Reset(); + return 0; + } + PlaySound(SPEECH_35, 0); + if (sHealth > 0 ) + sHealth = 0; + if ( sMana > 0 ) + sMana = 0; + break; + case Condition_Zombie: + if ( classType == PLAYER_CLASS_LICH || Eradicated() ||Zombie() || !Dead()) + return 0; + memset(&pConditions[0], 0, sizeof(pConditions)); + sHealth = GetMaxHealth(); + sMana = 0; + player_sex = 0; + uPrevFace = uCurrentFace; + uPrevVoiceID = uVoiceID; + switch ( uVoiceID ) + { + case 0: + case 1: + case 2: + case 3: + case 8: + case 9: + case 12: + case 13: + case 16: + case 17: + case 20: + case 23: + player_sex = 0; + break; + case 4: + case 5: + case 6: + case 7: + case 10: + case 11: + case 14: + case 15: + case 18: + case 19: + case 21: + case 24: + player_sex = 1; + break; + default: + break; + } + + zombi_face = (player_sex != 0) + 23; + uCurrentFace = zombi_face; + uVoiceID = zombi_face; + PlaySound((PlayerSpeech)SPEECH_99, 0); + break; } - v28 = 0; - v25 = SPEECH_35; -LABEL_67: - v3->PlaySound((PlayerSpeech)v25, v28); - if ( v3->sHealth > 0 ) - v3->sHealth = 0; - v13 = (char *)&v3->sMana; -LABEL_70: - if ( *(int *)v13 > 0 ) - *(int *)v13 = 0; -LABEL_82: - v21 = 0; - *(_QWORD *)v29 = pParty->uTimePlayed; - v31 = 0; - v22 = 1; - do - { - if ( pPlayers[v22]->CanAct() ) - { - ++v31; - v21 = v22; - } - ++v22; - } - while ( v22 <= 4 ); - if ( v30 == 2 ) - { - if ( v31 == 1 ) - pPlayers[v21]->PlaySound(SPEECH_107, 0); - } - result = 1; - break; - case 0x11u: - if ( v3->classType == PLAYER_CLASS_LICH || v3->Eradicated() || - v3->Zombie() || !v3->Dead()) - goto LABEL_76; - memset(v3, 0, 0xA0u); - v3->sHealth = v3->GetMaxHealth(); - v18 = 0; - v3->field_1928 = v3->uFace; - v19 = v3->uVoiceID; - v3->sMana = 0; - v3->field_1924 = v19; - switch ( v19 ) + + remainig_player = 0; + pConditions[uConditionIdx] = pParty->uTimePlayed; + players_after = 0; + for (int i=1;i<5;++i) { - case 0: - case 1: - case 2: - case 3: - case 8: - case 9: - case 12: - case 13: - case 16: - case 17: - case 20: - case 23: - v18 = 0; - break; - case 4: - case 5: - case 6: - case 7: - case 10: - case 11: - case 14: - case 15: - case 18: - case 19: - case 21: - case 24: - v18 = 1; - break; - default: - break; + + + if ( pPlayers[i]->CanAct() ) + { + remainig_player=i; + ++players_after; + } } - v26 = 0; - v20 = (v18 != 0) + 23; - v23 = SPEECH_99; - v3->uFace = v20; - v3->uVoiceID = v20; -LABEL_81: - v3->PlaySound((PlayerSpeech)v23, v26); - goto LABEL_82; - default: - goto LABEL_82; - } - } - return result; -} + if (( players_before == 2 )&&( players_after == 1 )) + { + pPlayers[remainig_player]->PlaySound(SPEECH_107, 0); + } + return 1; + } //----- (00492528) -------------------------------------------------------- bool Player::CanFitItem(unsigned int uSlot, unsigned int uItemID) @@ -1506,7 +1447,7 @@ } //----- (004927A8) -------------------------------------------------------- -int Player::AddItem(unsigned int uSlot, unsigned int uItemID) +int Player::AddItem(int uSlot, unsigned int uItemID) { signed int v3; // ebx@2 signed int v4; // edi@3 @@ -1519,7 +1460,7 @@ if ( uSlot == -1 ) { v3 = 0; - while ( 2 ) + while ( true ) { v4 = 0; v5 = v3; @@ -1553,7 +1494,7 @@ } //----- (00492826) -------------------------------------------------------- -int Player::AddItem2(unsigned int uSlot, ItemGen *Src) +int Player::AddItem2(int uSlot, ItemGen *Src) { unsigned int v3; // ebx@1 unsigned int v4; // esi@3 @@ -1569,7 +1510,7 @@ if ( uSlot == -1 ) { uSlota = 0; - while ( 2 ) + while ( true ) { v4 = uSlota; v5 = 0; @@ -1606,13 +1547,13 @@ ItemGen *v4; // eax@1 int result; // eax@6 //unsigned int v6; // eax@7 - Texture *v7; // esi@7 + Texture *item_texture; // esi@7 unsigned int v8; // edx@9 - void *v9; // esi@10 - unsigned int v10; // [sp+4h] [bp-Ch]@7 - unsigned int v11; // [sp+8h] [bp-8h]@7 + int *pInvPos; // esi@10 + unsigned int slot_width; // [sp+4h] [bp-Ch]@7 + unsigned int slot_height; // [sp+8h] [bp-8h]@7 Player *v12; // [sp+Ch] [bp-4h]@1 - unsigned int uSlota; // [sp+18h] [bp+8h]@10 + v12 = this; v3 = 0; @@ -1633,30 +1574,28 @@ } else { - v7 = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[Src->uItemID].pIconName, TEXTURE_16BIT_PALETTE); - v10 = GetSizeInInventorySlots(v7->uTextureWidth); - v11 = GetSizeInInventorySlots(v7->uTextureHeight); + item_texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[Src->uItemID].pIconName, TEXTURE_16BIT_PALETTE); + slot_width = GetSizeInInventorySlots(item_texture->uTextureWidth); + slot_height = GetSizeInInventorySlots(item_texture->uTextureHeight); if ( !areWeLoadingTexture ) { - v7->Release(); + item_texture->Release(); pIcons_LOD->SyncLoadedFilesCount(); } - v8 = uSlot; - if ( (signed int)v11 > 0 ) - { - uSlota = v11; - v9 = &v12->pInventoryIndices[v8]; + if ( slot_height > 0 ) + { + pInvPos = &pInventoryIndices[uSlot]; do { - if ( (signed int)v10 > 0 ) - memset32(v9, -1 - v8, v10); - v9 = (char *)v9 + 56; - --uSlota; - } - while ( uSlota ); - } - v12->pInventoryIndices[v8] = v3 + 1; - memcpy(&v12->pInventoryItems[v3], Src, 0x24u); + if ( slot_width > 0 ) + memset32(pInvPos, -1 - uSlot, slot_width); + pInvPos +=14; + --slot_height; + } + while ( slot_height ); + } + pInventoryIndices[uSlot] = v3 + 1; + memcpy(&pInventoryItems[v3], Src, sizeof(ItemGen)); result = v3 + 1; } return result; @@ -1664,36 +1603,36 @@ // 506128: using guessed type int areWeLoadingTexture; //----- (0049298B) -------------------------------------------------------- -bool Player::_49298B(ItemGen *a2, int a3, int a4) -{ +int Player::PutItemArInventoryIndex( ItemGen *item, int item_id, int uSlot ) + { //Player *v4; // ebx@1 //unsigned int v5; // eax@1 - Texture *v6; // esi@1 - void *v7; // esi@4 - unsigned int v9; // [sp+Ch] [bp-4h]@1 - unsigned int a2a; // [sp+18h] [bp+8h]@1 - - v6 = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[a2->uItemID].pIconName, TEXTURE_16BIT_PALETTE); - v9 = GetSizeInInventorySlots(v6->uTextureWidth); - a2a = GetSizeInInventorySlots(v6->uTextureHeight); + Texture *item_texture; // esi@1 + int *pInvPos; // esi@4 + unsigned int slot_width; // [sp+Ch] [bp-4h]@1 + unsigned int slot_height; // [sp+18h] [bp+8h]@1 + + item_texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE); + slot_width = GetSizeInInventorySlots(item_texture->uTextureWidth); + slot_height = GetSizeInInventorySlots(item_texture->uTextureHeight); if ( !areWeLoadingTexture ) { - v6->Release(); + item_texture->Release(); pIcons_LOD->SyncLoadedFilesCount(); } - if ( (signed int)a2a > 0 ) - { - v7 = &pInventoryIndices[a4]; + if ( (signed int)slot_height > 0 ) + { + pInvPos = &pInventoryIndices[uSlot]; //14x9 do { - if ( (signed int)v9 > 0 ) - memset32(v7, -1 - a4, v9); - v7 = (char *)v7 + 56; - --a2a; - } - while ( a2a ); - } - pInventoryIndices[a4] = a3 + 1; + if ( (signed int)slot_width > 0 ) + memset32(pInvPos, -1 - uSlot, slot_width); + pInvPos +=14; + --slot_height; + } + while ( slot_height ); + } + pInventoryIndices[uSlot] = item_id + 1; return 1; } @@ -1702,43 +1641,34 @@ //----- (00492A36) -------------------------------------------------------- void Player::RemoveItemAtInventoryIndex( unsigned int uSlot ) { - int *pIndices; // edi@1 - ItemGen *v3; // ecx@1 - unsigned int v4; // esi@1 - //unsigned int v5; // eax@1 - Texture *v6; // esi@1 - unsigned int result; // eax@1 - unsigned int v8; // ebp@1 - void *v9; // edx@4 - unsigned int uSlota; // [sp+14h] [bp+4h]@1 - - pIndices = &this->pInventoryIndices[uSlot]; - v3 = &this->pInventoryItems[*pIndices-1]; - v4 = v3->uItemID; - v3->Reset(); - v6 = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[v4].pIconName, TEXTURE_16BIT_PALETTE); - uSlota = GetSizeInInventorySlots(v6->uTextureWidth); - result = GetSizeInInventorySlots(v6->uTextureHeight); - v8 = result; + + ItemGen *item_in_slot; // ecx@1 + Texture *item_texture; // esi@1 + unsigned int slot_height; // ebp@1 + int *pInvPos; // edx@4 + unsigned int slot_width; // [sp+14h] [bp+4h]@1 + + item_in_slot = &this->pInventoryItems[pInventoryIndices[uSlot]-1]; + item_texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[item_in_slot->uItemID].pIconName, TEXTURE_16BIT_PALETTE); + item_in_slot->Reset(); + slot_width = GetSizeInInventorySlots(item_texture->uTextureWidth); + slot_height = GetSizeInInventorySlots(item_texture->uTextureHeight); if ( !areWeLoadingTexture ) { - v6->Release(); + item_texture->Release(); pIcons_LOD->SyncLoadedFilesCount(); } - if ( (signed int)v8 > 0 ) - { - v9 = pIndices; + if ( slot_height > 0 ) + { + pInvPos = &pInventoryIndices[uSlot]; do { - if ( (signed int)uSlota > 0 ) - { - result = 0; - memset(v9, 0, 4 * uSlota); - } - v9 = (char *)v9 + 56; - --v8; - } - while ( v8 ); + if (slot_width > 0 ) + memset32(pInvPos, 0, slot_width); + pInvPos += 14; + --slot_height; + } + while ( slot_height ); } } @@ -2036,7 +1966,6 @@ int v4; // eax@3 int v5; // edi@7 signed int v6; // ebp@7 - char v8; // al@10 signed int v10; // [sp-4h] [bp-14h]@2 @@ -2244,7 +2173,7 @@ } pName[0] = 0; - uFace = 0; + uCurrentFace = 0; uVoiceID = 0; memset(pConditions, 0, 20 * sizeof(__int64)); @@ -2381,7 +2310,7 @@ { v9 = &v20->pPlayers[v15[v8]]; v19 = &v20->pPlayers[v15[v8]]; - v10 = v19->AddItem(0xFFFFFFFFu, pItem->uItemID); + v10 = v19->AddItem(-1, pItem->uItemID); if ( v10 ) break; ++v8; @@ -4447,7 +4376,6 @@ signed int v2; // edi@1 Player *v3; // esi@1 enum CHARACTER_RACE v4; // ebx@1 - Player *v5; // ecx@8 char v6; // zf@18 int v7; // ebx@28 int result; // eax@28 @@ -6295,31 +6223,29 @@ // 24 zombie female enum CHARACTER_RACE Player::GetRace() { - if ( uFace > 15 ) - { - if ( uFace >= 16 && uFace <= 19 ) + if ( uCurrentFace > 15 ) + { + if ( uCurrentFace >= 16 && uCurrentFace <= 19 ) return CHARACTER_RACE_GOBLIN; } else { - if ( uFace >= 12 ) + if ( uCurrentFace >= 12 ) { return CHARACTER_RACE_DWARF; } else { - if ( uFace >= 0 ) - { - if ( uFace <= 7 ) + + if ( uCurrentFace <= 7 ) { return CHARACTER_RACE_HUMAN; } else { - if ( uFace <= 11 ) + if ( uCurrentFace <= 11 ) return CHARACTER_RACE_ELF; } - } } } return CHARACTER_RACE_HUMAN; @@ -6863,9 +6789,9 @@ __int16 uGreen; // [sp+8h] [bp-8h]@1 __int16 uRed; // [sp+Ch] [bp-4h]@1 - uRed = TargetColor(0xFFu, 0x23u, 0); - uGreen = TargetColor(0, 0xFFu, 0); - uWhite = TargetColor(0xFFu, 0xFFu, 0xFFu); + uRed = TargetColor(255, 35, 0); + uGreen = TargetColor(0, 255, 0); + uWhite = TargetColor(255, 255, 255); pBaseAttrValue = StatTable[GetRace()][uStat].uBaseValue; switch (uStat) @@ -6890,20 +6816,13 @@ //----- (004908A8) -------------------------------------------------------- bool Player::DiscardConditionIfLastsLongerThan(unsigned int uCondition, unsigned __int64 uTime) { - unsigned __int64 *result; // eax@1 - - result = (unsigned __int64 *)((char *)this + 8 * uCondition); - if ( *result && (signed __int64)uTime < (signed __int64)*result ) - { - *(int *)result = 0; - *((int *)result + 1) = 0; - LOBYTE(result) = 1; + if ( pConditions[uCondition] && (uTime < pConditions[uCondition]) ) + { + pConditions[uCondition]=0i64; + return true; } else - { - LOBYTE(result) = 0; - } - return (bool)result; + return false; } //----- (004680ED) -------------------------------------------------------- @@ -8600,19 +8519,19 @@ v4->sResMindBase = 200; v4->sResBodyBase = 200; v11 = v4->GetSexByVoice(); - v4->field_1924 = v4->uVoiceID; - v4->field_1928 = v4->uFace; + v4->uPrevVoiceID = v4->uVoiceID; + v4->uPrevFace = v4->uCurrentFace; if ( v11 ) { - v4->uFace = 21; + v4->uCurrentFace = 21; v4->uVoiceID = 21; } else { - v4->uFace = 20; + v4->uCurrentFace = 20; v4->uVoiceID = 20; } - ReloadPlayerPortraits(currPlayerId, v4->uFace); + ReloadPlayerPortraits(currPlayerId, v4->uCurrentFace); goto LABEL_124; } LABEL_64: