# HG changeset patch # User Grumpy7 # Date 1373671840 -7200 # Node ID e721754db8eef5cdadaa535711d65a3a481bf8a0 # Parent 3ed6dcf829126bcdc079d0c6273c28116c91f231 Player::ItemsEnchant slight simplification diff -r 3ed6dcf82912 -r e721754db8ee Player.cpp --- a/Player.cpp Sat Jul 13 00:25:19 2013 +0200 +++ b/Player.cpp Sat Jul 13 01:30:40 2013 +0200 @@ -479,33 +479,30 @@ avalible_items = 0; memset (item_index_tabl,0,sizeof(item_index_tabl)); - for (i=0; i<138; ++i) - { - if (( pOwnItems[i].uItemID>0)&&(pOwnItems[i].uItemID<= 134)) - item_index_tabl[avalible_items++] = i; - } + for (i = 0; i < 138; ++i) + { + if (( pOwnItems[i].uItemID>0)&&(pOwnItems[i].uItemID <= 134)) + item_index_tabl[avalible_items++] = i; + } if ( avalible_items ) { if ( enchant_count ) { - for ( i = 0; i < enchant_count; ++i ) - { + for ( i = 0; i < enchant_count; ++i ) + { if (!(pInventoryItems[item_index_tabl[i]].uAttributes&ITEM_ENCHANTED)) - pInventoryItems[item_index_tabl[rand() % avalible_items]].uAttributes|=ITEM_ENCHANTED; - } - + pInventoryItems[item_index_tabl[rand() % avalible_items]].uAttributes |= ITEM_ENCHANTED; + } } else { for ( i = 0; i < avalible_items; ++i ) { - if (!(pInventoryItems[item_index_tabl[i]].uAttributes&ITEM_ENCHANTED)) - pInventoryItems[item_index_tabl[i]].uAttributes|=ITEM_ENCHANTED; - } - } - } - ; + pInventoryItems[item_index_tabl[i]].uAttributes |= ITEM_ENCHANTED; + } + } + } } //----- (004948B1) --------------------------------------------------------