Mercurial > mm7
changeset 1349:e721754db8ee
Player::ItemsEnchant slight simplification
author | Grumpy7 |
---|---|
date | Sat, 13 Jul 2013 01:30:40 +0200 |
parents | 3ed6dcf82912 |
children | 8baf20c8f805 |
files | Player.cpp |
diffstat | 1 files changed, 13 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- 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) --------------------------------------------------------