comparison Player.cpp @ 1409:c9e3b93ec570

Highlighted locations with "using uninitialized variable" warning.
author Nomad
date Fri, 26 Jul 2013 21:16:51 +0200
parents d4f57df4c299
children 2423bc2af692
comparison
equal deleted inserted replaced
1408:204cce84300b 1409:c9e3b93ec570
2866 v14 = 0; 2866 v14 = 0;
2867 do 2867 do
2868 { 2868 {
2869 if ( HasItemEquipped((ITEM_EQUIP_TYPE)v14) ) 2869 if ( HasItemEquipped((ITEM_EQUIP_TYPE)v14) )
2870 { 2870 {
2871 __debugbreak(); // player.cpp(2871): warning C4700: uninitialized local variable 'v15' used
2871 if ( v15 == EQUIP_ARMOUR ) 2872 if ( v15 == EQUIP_ARMOUR )
2872 v46[v4++] = LOBYTE(v5->pEquipment.uArmor) - 1; 2873 v46[v4++] = LOBYTE(v5->pEquipment.uArmor) - 1;
2873 if ( (!v15 || v15 == 1) && GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v15) == 4 ) 2874 if ( (!v15 || v15 == 1) && GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v15) == 4 )
2874 v46[v4++] = *((char *)&v5->pEquipment.uShield + 4 * v15) - 1; 2875 v46[v4++] = *((char *)&v5->pEquipment.uShield + 4 * v15) - 1;
2875 } 2876 }
2881 v16 = 0; 2882 v16 = 0;
2882 do 2883 do
2883 { 2884 {
2884 if ( HasItemEquipped((ITEM_EQUIP_TYPE)v16) ) 2885 if ( HasItemEquipped((ITEM_EQUIP_TYPE)v16) )
2885 { 2886 {
2887 __debugbreak(); // player.cpp(2886): warning C4700: uninitialized local variable 'v17' used
2886 if ( v17 == 2 ) 2888 if ( v17 == 2 )
2887 v46[v4++] = LOBYTE(v5->pEquipment.uBow) - 1; 2889 v46[v4++] = LOBYTE(v5->pEquipment.uBow) - 1;
2888 if ( (!v17 || v17 == 1) 2890 if ( (!v17 || v17 == 1)
2889 && (!GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v17) || GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v17) == 1) ) 2891 && (!GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v17) || GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v17) == 1) )
2890 v46[v4++] = *((char *)&v5->pEquipment.uShield + 4 * v17) - 1; 2892 v46[v4++] = *((char *)&v5->pEquipment.uShield + 4 * v17) - 1;
3685 int v19; // eax@67 3687 int v19; // eax@67
3686 int v20; // eax@69 3688 int v20; // eax@69
3687 Player *v21; // ecx@75 3689 Player *v21; // ecx@75
3688 int v22; // eax@76 3690 int v22; // eax@76
3689 int v23; // edx@76 3691 int v23; // edx@76
3690 int v24; // eax@79 3692 //int v24; // eax@79
3691 int v25; // ecx@80 3693 int v25; // ecx@80
3692 int v26; // edi@80 3694 int v26; // edi@80
3693 Player *v27; // ecx@84 3695 Player *v27; // ecx@84
3694 int v28; // eax@85 3696 int v28; // eax@85
3695 int v29; // edx@85 3697 int v29; // edx@85
4383 if ( v22 <= 2 ) 4385 if ( v22 <= 2 )
4384 { 4386 {
4385 v23 = this->pOwnItems[this->pEquipment.uMainHand].uItemID; 4387 v23 = this->pOwnItems[this->pEquipment.uMainHand].uItemID;
4386 if ( v6->pEquipment.uShield || pItemsTable->pItems[v23].uSkillType != 4 ) 4388 if ( v6->pEquipment.uShield || pItemsTable->pItems[v23].uSkillType != 4 )
4387 { 4389 {
4388 v24 = v23;
4389 v26 = pItemsTable->pItems[v23].uDamageRoll; 4390 v26 = pItemsTable->pItems[v23].uDamageRoll;
4390 v25 = pItemsTable->pItems[v23].uDamageDice; 4391 v25 = pItemsTable->pItems[v23].uDamageDice;
4391 } 4392 }
4392 else 4393 else
4393 { 4394 {
4394 v25 = pItemsTable->pItems[v24].uDamageRoll; 4395 v25 = pItemsTable->pItems[v23].uDamageRoll;
4395 v26 = pItemsTable->pItems[v24].uDamageDice + 1; 4396 v26 = pItemsTable->pItems[v23].uDamageDice + 1;
4396 } 4397 }
4397 v5 = pItemsTable->pItems[v24].uDamageMod + v25 * v26; 4398 v5 = pItemsTable->pItems[v23].uDamageMod + v25 * v26;
4398 } 4399 }
4399 } 4400 }
4400 } 4401 }
4401 4402
4402 if ( a3 || !v6->HasItemEquipped(EQUIP_OFF_HAND) ) 4403 if ( a3 || !v6->HasItemEquipped(EQUIP_OFF_HAND) )
5246 goto LABEL_55; 5247 goto LABEL_55;
5247 } 5248 }
5248 5249
5249 5250
5250 assert(false && "Unknown attribute!"); 5251 assert(false && "Unknown attribute!");
5252 return 0;
5251 } 5253 }
5252 5254
5253 //----- (00490109) -------------------------------------------------------- 5255 //----- (00490109) --------------------------------------------------------
5254 // faces are: 0 1 2 3 human males 5256 // faces are: 0 1 2 3 human males
5255 // 4 5 6 7 human females 5257 // 4 5 6 7 human females
5327 case 0x12u: 5329 case 0x12u:
5328 case 0x13u: 5330 case 0x13u:
5329 case 0x15u: 5331 case 0x15u:
5330 case 0x18u: 5332 case 0x18u:
5331 return SEX_FEMALE; 5333 return SEX_FEMALE;
5332 5334 }
5333 default: 5335 assert(false);
5334 assert(false); 5336 return SEX_MALE;
5335 }
5336 } 5337 }
5337 5338
5338 //----- (00490188) -------------------------------------------------------- 5339 //----- (00490188) --------------------------------------------------------
5339 void Player::SetInitialStats() 5340 void Player::SetInitialStats()
5340 { 5341 {
5578 if ( counter == order - offset ) 5579 if ( counter == order - offset )
5579 return (PLAYER_SKILL_TYPE)i; 5580 return (PLAYER_SKILL_TYPE)i;
5580 ++counter; 5581 ++counter;
5581 } 5582 }
5582 } 5583 }
5584
5585 assert(false);
5583 } 5586 }
5584 5587
5585 5588
5586 5589
5587 //----- (0049048D) -------------------------------------------------------- 5590 //----- (0049048D) --------------------------------------------------------
8630 return true; 8633 return true;
8631 } 8634 }
8632 return false; 8635 return false;
8633 } 8636 }
8634 } 8637 }
8638
8639 assert(false);
8640 return false;
8635 } 8641 }
8636 // 5B65C4: using guessed type int dword_5B65C4; 8642 // 5B65C4: using guessed type int dword_5B65C4;
8637 // 5B65CC: using guessed type int dword_5B65CC; 8643 // 5B65CC: using guessed type int dword_5B65CC;
8638 8644
8639 8645
8743 while ( 1 ) 8749 while ( 1 )
8744 { 8750 {
8745 result = Player_has_item(v5, *pPlayers, 0); 8751 result = Player_has_item(v5, *pPlayers, 0);
8746 if ( !result ) 8752 if ( !result )
8747 break; 8753 break;
8754 __debugbreak(); // player.cpp(8748): warning C4700: uninitialized local variable 'v6' used
8748 result = v6->pEquipment.uArmor; 8755 result = v6->pEquipment.uArmor;
8749 if ( !result ) 8756 if ( !result )
8750 break; 8757 break;
8751 result *= 9; 8758 result *= 9;
8752 if ( *(int *)&v6->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5] != v5 ) 8759 if ( *(int *)&v6->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5] != v5 )
8757 } 8764 }
8758 } 8765 }
8759 goto LABEL_6; 8766 goto LABEL_6;
8760 } 8767 }
8761 result = Player_has_item(604u, ::pPlayers[a1], 0); 8768 result = Player_has_item(604u, ::pPlayers[a1], 0);
8769 __debugbreak(); // player.cpp(8764): warning C4700: uninitialized local variable 'v2' used
8770 __debugbreak(); // player.cpp(8764): warning C4700: uninitialized local variable 'v3' used
8762 if ( !result 8771 if ( !result
8763 || (result = v2->pEquipment.uArmor) == 0 8772 || (result = v2->pEquipment.uArmor) == 0
8764 || (result *= 9, *(int *)&v2->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5] != v3) ) 8773 || (result *= 9, *(int *)&v2->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5] != v3) )
8765 { 8774 {
8766 LABEL_6: 8775 LABEL_6: