# HG changeset patch # User Grumpy7 # Date 1379828042 -7200 # Node ID 133a5f62bc8c010a9924354c36f1aaa6084fa3af # Parent ece764a4672d5ffaa892fa4cfb38fa930141974c Player::_48DCF6 fixing use of uninitialized vars diff -r ece764a4672d -r 133a5f62bc8c Player.cpp --- 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: