changeset 1153:ed9f6627dc7a

bugfix character hand draw
author Gloval
date Sun, 02 Jun 2013 22:16:39 +0400
parents 354ec6263123
children 8ce08eea96ed
files UICharacter.cpp
diffstat 1 files changed, 21 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/UICharacter.cpp	Sun Jun 02 05:42:28 2013 +0200
+++ b/UICharacter.cpp	Sun Jun 02 22:16:39 2013 +0400
@@ -87,7 +87,7 @@
 int paperdoll_cloak_collar_texture[4][10]; // weak
 int paperdoll_cloak_texture[4][10];
 int paperdoll_helm_texture[2][16]; //511698
-int paperdoll_belt_texture[2][7];  //511718
+int paperdoll_belt_texture[4][7];  //511718
 
 
 const int paperdoll_Weapon[4][16][2] = {//4E4C30
@@ -934,7 +934,7 @@
       item_MainHand4 = &pPlayers[uPlayerID]->pInventoryItems[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 )
+      if ( item_MainHand4->uItemID == 64 )  //blaster
         v166 = "item64v1";
       else
         v166 = pItemsTable->pItems[item_MainHand4->uItemID].pIconName;
@@ -1323,9 +1323,9 @@
     pMainHandNum = pPlayers[uPlayerID]->pEquipment.uMainHand;
     if ( !pMainHandNum || (v70 = *(int *)&pPlayers[uPlayerID]->pInventoryItems[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],
-                     pIcons_LOD->GetTexture(papredoll_dlads[uPlayerID - 1]));
+                pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0],
+                                                  pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1],
+                                                   pIcons_LOD->GetTexture(papredoll_dlads[uPlayerID - 1]));
         pBeltNum = pPlayers[uPlayerID]->pEquipment.uBelt;// далее пояс
         if ( pBeltNum )
         {
@@ -1392,12 +1392,12 @@
       pMainHandNum2 = pPlayers[uPlayerID]->pEquipment.uMainHand;
       if ( pMainHandNum2 )
       {
-        v83 = *(int *)&pPlayers[uPlayerID]->pInventoryItems[pMainHandNum2 - 1];
+        v83 = pPlayers[uPlayerID]->pInventoryItems[pMainHandNum2 - 1].uItemID;
         if ( pItemsTable->pItems[v83].uEquipType == 1
-             || pItemsTable->pItems[v83].uSkillType == 4 && !pPlayers[uPlayerID]->pEquipment.uShield )
+             || pItemsTable->pItems[v83].uSkillType == PLAYER_SKILL_SPEAR && !pPlayers[uPlayerID]->pEquipment.uShield )
           pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0],
-             pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1],
-             pIcons_LOD->GetTexture(papredoll_dlaus[uPlayerID - 1]));
+                                            pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1],
+                                            pIcons_LOD->GetTexture(papredoll_dlaus[uPlayerID - 1]));
       }
       pCloakCollarNum = pPlayers[uPlayerID]->pEquipment.uCloak;//далее воротник плаща
       if ( pCloakCollarNum )
@@ -1674,8 +1674,12 @@
   if ( pMainHandNum5 )
   {
     item_MainHand5 = &pPlayers[uPlayerID]->pInventoryItems[pMainHandNum5 - 1];
-    if ( pItemsTable->pItems[item_MainHand5->uItemID].uEquipType == 1 || pItemsTable->pItems[item_MainHand5->uItemID].uSkillType == 4 && !pPlayers[uPlayerID]->pEquipment.uShield )
-      pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlhus[uPlayerID - 1]));
+    if ( pItemsTable->pItems[item_MainHand5->uItemID].uEquipType == 1 || 
+        pItemsTable->pItems[item_MainHand5->uItemID].uSkillType == PLAYER_SKILL_SPEAR && 
+         !pPlayers[uPlayerID]->pEquipment.uShield )
+      pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0], 
+                                        pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1], 
+                                        pIcons_LOD->GetTexture(papredoll_dlhus[uPlayerID - 1]));
   }
   if ( !bRingsShownInCharScreen )//рисование лупы
     pRenderer->DrawTextureTransparent(603, 299, pIcons_LOD->GetTexture(uTextureID_MAGNIF_B));
@@ -1931,25 +1935,20 @@
     }
     else
     {
-      v6 = v30;
       papredoll_dbods[v30] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE);
       papredoll_dlads[v30] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE);
       papredoll_dlaus[v30] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE);
       papredoll_drhs[v30] = pIcons_LOD->LoadTexture(drh_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE);
       papredoll_dlhs[v30] = pIcons_LOD->LoadTexture(dlh_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE);
-      v7 = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE);
-      pPlayer2 = pPlayers[v30 + 1];
-      papredoll_dlhus[v30] = v7;
-      v9 = (char *)&pPlayer2->uCurrentFace;
-      v10 = *v9;
-      if ( *v9 == 12 || v10 == 13 )
+      papredoll_dlhus[v30] = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE);
+      v10 = pPlayers[v30 + 1]->uCurrentFace;
+      if ( v10 == 12 || v10 == 13 )
       {
         wsprintfA(pContainer, "pc%02dbrd", v10 + 1);
-        v9 = (char *)&pPlayers[v6 + 1]->uCurrentFace;
-        papredoll_dbrds[*v9] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
+        papredoll_dbrds[v10] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
       }
-      wsprintfA(pContainer, "item281pc%02d", *v9 + 1);
-      papredoll_flying_feet[pPlayers[v6 + 1]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
+      wsprintfA(pContainer, "item281pc%02d", v10 + 1);
+      papredoll_flying_feet[pPlayers[v30 + 1]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
       IsPlayerWearingWatersuit[v30 + 1] = 0;
     }
     ++v30;