Mercurial > mm7
diff UI/UICharacter.cpp @ 1384:b51332ab228f
changed a few member variables in Player to slightly less confusing names
author | Grumpy7 |
---|---|
date | Tue, 16 Jul 2013 20:51:29 +0200 |
parents | b691c96d8e06 |
children | 28f87f5234a1 |
line wrap: on
line diff
--- a/UI/UICharacter.cpp Tue Jul 16 00:40:01 2013 +0200 +++ b/UI/UICharacter.cpp Tue Jul 16 20:51:29 2013 +0200 @@ -928,14 +928,14 @@ if ( !bRingsShownInCharScreen ) pRenderer->DrawMaskToZBuffer(pPaperdoll_BodyX, pPaperdoll_BodyY, pIcons_LOD->GetTexture(papredoll_dbods[uPlayerID - 1]), player->pEquipment.uArmor); v6 = player->pEquipment.uMainHand; - if ( !v6 || (v7 = *(int *)&pPlayers[uPlayerID]->pInventoryItems[v6-1], pItemsTable->pItems[v7].uEquipType != 1) + if ( !v6 || (v7 = *(int *)&pPlayers[uPlayerID]->pInventoryItemList[v6-1], pItemsTable->pItems[v7].uEquipType != 1) && (pItemsTable->pItems[v7].uSkillType != 4 || pPlayers[uPlayerID]->pEquipment.uShield) ) pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlads[uPlayerID - 1])); pMainHandNum4 = pPlayers[uPlayerID]->pEquipment.uMainHand; if ( pMainHandNum4 ) { - item_MainHand4 = &pPlayers[uPlayerID]->pInventoryItems[pMainHandNum4 - 1]; + item_MainHand4 = &pPlayers[uPlayerID]->pInventoryItemList[pMainHandNum4 - 1]; pX_MainHand4 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[item_MainHand4->uItemID].uEquipX; pY_MainHand4 = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[item_MainHand4->uItemID].uEquipY; if ( item_MainHand4->uItemID == 64 ) //blaster @@ -987,7 +987,7 @@ pBowNum = pPlayers[uPlayerID]->pEquipment.uBow; //сначала рисуется лук if ( pBowNum ) { - itemBow = &pPlayers[uPlayerID]->pInventoryItems[pBowNum - 1]; + itemBow = &pPlayers[uPlayerID]->pInventoryItemList[pBowNum - 1]; pX_Bow = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][2][0] - pItemsTable->pItems[itemBow->uItemID].uEquipX; pY_Bow = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][2][1] - pItemsTable->pItems[itemBow->uItemID].uEquipY; pBowTextureNum = pIcons_LOD->LoadTexture(pItemsTable->pItems[itemBow->uItemID].pIconName, TEXTURE_16BIT_PALETTE); @@ -1031,7 +1031,7 @@ pCloakNum = pPlayers[uPlayerID]->pEquipment.uCloak;// потом плащ if ( pCloakNum ) { - item_Cloak = &pPlayers[uPlayerID]->pInventoryItems[pCloakNum - 1]; + item_Cloak = &pPlayers[uPlayerID]->pInventoryItemList[pCloakNum - 1]; switch ( item_Cloak->uItemID ) { case ITEM_RELIC_TWILIGHT: @@ -1096,7 +1096,7 @@ pArmorNum = pPlayers[uPlayerID]->pEquipment.uArmor;// потом броня if ( pArmorNum ) { - item_Armor = &pPlayers[uPlayerID]->pInventoryItems[pArmorNum - 1]; + item_Armor = &pPlayers[uPlayerID]->pInventoryItemList[pArmorNum - 1]; switch ( item_Armor->uItemID ) { case 504: @@ -1265,7 +1265,7 @@ pBootNum = pPlayers[uPlayerID]->pEquipment.uBoot;//далее обувь if ( pBootNum ) { - item_Boot = &pPlayers[uPlayerID]->pInventoryItems[pBootNum - 1]; + item_Boot = &pPlayers[uPlayerID]->pInventoryItemList[pBootNum - 1]; switch ( item_Boot->uItemID ) { case 529: @@ -1325,7 +1325,7 @@ } } pMainHandNum = pPlayers[uPlayerID]->pEquipment.uMainHand; - if ( !pMainHandNum || (v70 = *(int *)&pPlayers[uPlayerID]->pInventoryItems[pMainHandNum -1], pItemsTable->pItems[v70].uEquipType != 1) + if ( !pMainHandNum || (v70 = *(int *)&pPlayers[uPlayerID]->pInventoryItemList[pMainHandNum -1], pItemsTable->pItems[v70].uEquipType != 1) && (pItemsTable->pItems[v70].uSkillType != 4 || pPlayers[uPlayerID]->pEquipment.uShield) ) pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1], @@ -1333,7 +1333,7 @@ pBeltNum = pPlayers[uPlayerID]->pEquipment.uBelt;// далее пояс if ( pBeltNum ) { - item_Belt = &pPlayers[uPlayerID]->pInventoryItems[pBeltNum - 1]; + item_Belt = &pPlayers[uPlayerID]->pInventoryItemList[pBeltNum - 1]; switch ( item_Belt->uItemID ) { case ITEM_RILIC_TITANS_BELT: @@ -1396,7 +1396,7 @@ pMainHandNum2 = pPlayers[uPlayerID]->pEquipment.uMainHand; if ( pMainHandNum2 ) { - v83 = pPlayers[uPlayerID]->pInventoryItems[pMainHandNum2 - 1].uItemID; + v83 = pPlayers[uPlayerID]->pInventoryItemList[pMainHandNum2 - 1].uItemID; if ( pItemsTable->pItems[v83].uEquipType == 1 || pItemsTable->pItems[v83].uSkillType == PLAYER_SKILL_SPEAR && !pPlayers[uPlayerID]->pEquipment.uShield ) pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0], @@ -1406,7 +1406,7 @@ pCloakCollarNum = pPlayers[uPlayerID]->pEquipment.uCloak;//далее воротник плаща if ( pCloakCollarNum ) { - item_CloakCollar = &pPlayers[uPlayerID]->pInventoryItems[pCloakCollarNum - 1]; + item_CloakCollar = &pPlayers[uPlayerID]->pInventoryItemList[pCloakCollarNum - 1]; switch ( item_CloakCollar->uItemID ) { case 525: @@ -1480,7 +1480,7 @@ pHelmNum = pPlayers[uPlayerID]->pEquipment.uHelm;//далее шлем if ( pHelmNum ) { - item_Helm = &pPlayers[uPlayerID]->pInventoryItems[pHelmNum-1]; + item_Helm = &pPlayers[uPlayerID]->pInventoryItemList[pHelmNum-1]; switch ( item_Helm->uItemID ) { case 521: @@ -1551,7 +1551,7 @@ pMainHandNum3 = pPlayers[uPlayerID]->pEquipment.uMainHand;//weapon in right hand if ( pMainHandNum3 ) { - item_MainHand3 = &pPlayers[uPlayerID]->pInventoryItems[pMainHandNum3 - 1]; + item_MainHand3 = &pPlayers[uPlayerID]->pInventoryItemList[pMainHandNum3 - 1]; pX_MainHand3 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[item_MainHand3->uItemID].uEquipX; pY_MainHand3 = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[item_MainHand3->uItemID].uEquipY; if ( item_MainHand3->uItemID == 64 ) @@ -1600,7 +1600,7 @@ pShieldNum = pPlayers[uPlayerID]->pEquipment.uShield;// далее щит if ( pShieldNum ) { - item_Shield = &pPlayers[uPlayerID]->pInventoryItems[pShieldNum - 1]; + item_Shield = &pPlayers[uPlayerID]->pInventoryItemList[pShieldNum - 1]; v149 = pItemsTable->pItems[item_Shield->uItemID].uSkillType; if ( v149 == 2 || v149 == 1 ) { @@ -1677,7 +1677,7 @@ pMainHandNum5 = pPlayers[uPlayerID]->pEquipment.uMainHand; if ( pMainHandNum5 ) { - item_MainHand5 = &pPlayers[uPlayerID]->pInventoryItems[pMainHandNum5 - 1]; + item_MainHand5 = &pPlayers[uPlayerID]->pInventoryItemList[pMainHandNum5 - 1]; if ( pItemsTable->pItems[item_MainHand5->uItemID].uEquipType == 1 || pItemsTable->pItems[item_MainHand5->uItemID].uSkillType == PLAYER_SKILL_SPEAR && !pPlayers[uPlayerID]->pEquipment.uShield ) @@ -1716,13 +1716,13 @@ int i = 0; for (uint i = 0; i < 126; ++i) { - int v26 = (int)(player->pInventoryIndices + i); + int v26 = (int)(player->pInventoryMatrix + i); - if (player->pInventoryIndices[i] <= 0) + if (player->pInventoryMatrix[i] <= 0) continue; - int item_idx = player->pInventoryIndices[i]; - auto item = &player->pInventoryItems[item_idx - 1]; + int item_idx = player->pInventoryMatrix[i]; + auto item = &player->pInventoryItemList[item_idx - 1]; if (!item->uItemID) continue; @@ -1845,7 +1845,7 @@ CharacterUI_DrawItem(pPaperdollRingsX[i], pPaperdollRingsY[i], - &player->pInventoryItems[player->pEquipment.uRings[i] - 1], + &player->pInventoryItemList[player->pEquipment.uRings[i] - 1], player->pEquipment.uRings[i]); } @@ -1853,14 +1853,14 @@ if (player->pEquipment.uAmulet) { CharacterUI_DrawItem(493, 91, - &player->pInventoryItems[player->pEquipment.uAmulet - 1], + &player->pInventoryItemList[player->pEquipment.uAmulet - 1], player->pEquipment.uAmulet); } if (player->pEquipment.uGlove) { CharacterUI_DrawItem(586, 88, - &player->pInventoryItems[player->pEquipment.uGlove - 1], + &player->pInventoryItemList[player->pEquipment.uGlove - 1], player->pEquipment.uGlove); } } @@ -2688,7 +2688,7 @@ v2 = pPlayers[uActiveCharacter]->pEquipment.uShield; //v54 = pPlayers[uActiveCharacter]->pEquipment.uShield; //v53 = v1; - if ( v1 && pItemsTable->pItems[*(int *)&pPlayers[uActiveCharacter]->pInventoryItems[v1 - 1]].uEquipType == 1 ) + if ( v1 && pItemsTable->pItems[*(int *)&pPlayers[uActiveCharacter]->pInventoryItemList[v1 - 1]].uEquipType == 1 ) v51 = v1; v3 = pParty->pPickedItem.uItemID; if ( pParty->pPickedItem.uItemID ) @@ -2712,7 +2712,7 @@ { if ( (pSkillType == 8 || pSkillType == 1 || pSkillType == 2) && v1 - && pItemsTable->pItems[*(int *)&pPlayers[uActiveCharacter]->pInventoryItems[v1-1]].uSkillType == 4 ) + && pItemsTable->pItems[*(int *)&pPlayers[uActiveCharacter]->pInventoryItemList[v1-1]].uSkillType == 4 ) { LOBYTE(v5) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_SPEAR); if ( (signed int)SkillToMastery(v5) < 3 ) @@ -2771,12 +2771,12 @@ { if ( !*(int *)v7 ) { - v8 = pPlayers[uActiveCharacter]->FindFreeInventorySlot(); + v8 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); if ( v8 >= 0 ) { v9 = v52; pParty->pPickedItem.uBodyAnchor = v52 + 1; - memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v8], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItems[v8])); + memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v8], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v8])); *(&pPlayers[uActiveCharacter]->pEquipment.uShield + v9) = v8 + 1; pMouse->RemoveHoldingItem(); break; @@ -2830,14 +2830,14 @@ } else { - v52 = pPlayers[uActiveCharacter]->FindFreeInventorySlot(); + v52 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); if ( v52 < 0 ) return; if ( !v51 ) { pParty->pPickedItem.uBodyAnchor = 1; v17 = v52 + 1; - memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v52], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItems[v52])); + memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); pPlayers[uActiveCharacter]->pEquipment.uShield = v17; pMouse->RemoveHoldingItem(); return; @@ -2849,7 +2849,7 @@ pParty->SetHoldingItem((ItemGen *)(v15 + 532)); _this.uBodyAnchor = 1; v16 = v52 + 1; - memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItems[v52])); + memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); pPlayers[uActiveCharacter]->pEquipment.uShield = v16; } pPlayers[uActiveCharacter]->pEquipment.uMainHand = 0; @@ -2905,12 +2905,12 @@ } break; } - v23 = pPlayers[uActiveCharacter]->FindFreeInventorySlot(); + v23 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); if ( v23 < 0 ) return; pParty->pPickedItem.uBodyAnchor = 1; - v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItems[v23]; - memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v23], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItems[v23])); + v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItemList[v23]; + memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v23], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v23])); pPlayers[uActiveCharacter]->pEquipment.uShield = v23 + 1; pMouse->RemoveHoldingItem(); if ( v52 != 12 ) @@ -2928,12 +2928,12 @@ } if ( !v1 ) { - v26 = pPlayers[uActiveCharacter]->FindFreeInventorySlot(); + v26 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); if ( v26 < 0 ) return; pParty->pPickedItem.uBodyAnchor = 2; - v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItems[v26]; - memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v26], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItems[v26])); + v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItemList[v26]; + memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v26], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v26])); pPlayers[uActiveCharacter]->pEquipment.uMainHand = v26 + 1; pMouse->RemoveHoldingItem(); if ( v52 != 12 ) @@ -2999,7 +2999,7 @@ } else { - v52 = pPlayers[uActiveCharacter]->FindFreeInventorySlot(); + v52 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); if ( v52 >= 0 ) { if ( v2 ) @@ -3011,7 +3011,7 @@ pParty->SetHoldingItem((ItemGen *)(v29 + 532)); _this.uBodyAnchor = 2; v30 = v52 + 1; - memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItems[v52])); + memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); pPlayers[uActiveCharacter]->pEquipment.uShield = 0; pPlayers[uActiveCharacter]->pEquipment.uMainHand = v30; } @@ -3019,7 +3019,7 @@ { pParty->pPickedItem.uBodyAnchor = 2; v31 = v52 + 1; - memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v52], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItems[v52])); + memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); pPlayers[uActiveCharacter]->pEquipment.uMainHand = v31; pMouse->RemoveHoldingItem(); } @@ -3085,7 +3085,7 @@ v35 = pPlayers[uActiveCharacter]->pEquipment.uBow; if ( v35 ) { - auto _a = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v35 - 1]; + auto _a = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v35 - 1]; pParty->SetHoldingItem(_a); _a->Reset(); pPlayers[uActiveCharacter]->pEquipment.uBow = 0;