Mercurial > mm7
changeset 1689:133a5f62bc8c
Player::_48DCF6 fixing use of uninitialized vars
author | Grumpy7 |
---|---|
date | Sun, 22 Sep 2013 07:34:02 +0200 |
parents | ece764a4672d |
children | 95118ff8cc22 |
files | Player.cpp |
diffstat | 1 files changed, 9 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/Player.cpp Sun Sep 22 04:31:34 2013 +0200 +++ b/Player.cpp Sun Sep 22 07:34:02 2013 +0200 @@ -2377,13 +2377,12 @@ { if ( HasItemEquipped((ITEM_EQUIP_TYPE)v14) ) { - __debugbreak(); // player.cpp(2871): warning C4700: uninitialized local variable 'v15' used - if ( v15 == EQUIP_ARMOUR ) + if ( v14 == EQUIP_ARMOUR ) v46[v4++] = LOBYTE(v5->pEquipment.uArmor) - 1; - if ( (!v15 || v15 == 1) && GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v15) == 4 ) - v46[v4++] = *((char *)&v5->pEquipment.uShield + 4 * v15) - 1; + if ( (!v14 || v14 == 1) && GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v14) == 4 ) + v46[v4++] = *((char *)&v5->pEquipment.uShield + 4 * v14) - 1; } - v14 = v15 + 1; + v14++; } while ( v14 < 16 ); goto LABEL_36; @@ -2393,14 +2392,13 @@ { if ( HasItemEquipped((ITEM_EQUIP_TYPE)v16) ) { - __debugbreak(); // player.cpp(2886): warning C4700: uninitialized local variable 'v17' used - if ( v17 == 2 ) + if ( v16 == 2 ) v46[v4++] = LOBYTE(v5->pEquipment.uBow) - 1; - if ( (!v17 || v17 == 1) - && (!GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v17) || GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v17) == 1) ) - v46[v4++] = *((char *)&v5->pEquipment.uShield + 4 * v17) - 1; + if ( (!v16 || v16 == 1) + && (!GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v16) || GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v16) == 1) ) + v46[v4++] = *((char *)&v5->pEquipment.uShield + 4 * v16) - 1; } - v16 = v17 + 1; + v16++; } while ( v16 < 16 ); LABEL_36: