diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-06-26 10:27:47 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2014-06-26 15:04:16 -0700 |
commit | 34807ca9fccc7425573256645024722571ef4442 (patch) | |
tree | 5e716b7fa2d786b15da403072bb6f41f3dfbcc65 /src/map/chrif.cpp | |
parent | b353ae37eb6d374aec4127f1849a5dce81f812b5 (diff) | |
download | tmwa-34807ca9fccc7425573256645024722571ef4442.tar.gz tmwa-34807ca9fccc7425573256645024722571ef4442.tar.bz2 tmwa-34807ca9fccc7425573256645024722571ef4442.tar.xz tmwa-34807ca9fccc7425573256645024722571ef4442.zip |
specialize inventory/storage indices
Diffstat (limited to 'src/map/chrif.cpp')
-rw-r--r-- | src/map/chrif.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp index 3a329f8..ff0adbd 100644 --- a/src/map/chrif.cpp +++ b/src/map/chrif.cpp @@ -625,7 +625,6 @@ void chrif_changedgm(Session *, const Packet_Fixed<0x2b0b>& fixed) static void chrif_changedsex(Session *, const Packet_Fixed<0x2b0d>& fixed) { - int i; dumb_ptr<map_session_data> sd; AccountId acc = fixed.account_id; @@ -642,7 +641,7 @@ void chrif_changedsex(Session *, const Packet_Fixed<0x2b0d>& fixed) else if (sd->status.sex == SEX::FEMALE) sd->sex = sd->status.sex = SEX::MALE; // to avoid any problem with equipment and invalid sex, equipment is unequiped. - for (i = 0; i < MAX_INVENTORY; i++) + for (IOff0 i : IOff0::iter()) { if (sd->status.inventory[i].nameid && bool(sd->status.inventory[i].equip)) @@ -942,9 +941,8 @@ void ladmin_itemfrob_c2(dumb_ptr<block_list> bl, ItemNameId source_id, ItemNameI { dumb_ptr<map_session_data> pc = bl->is_player(); Storage *stor = account2storage2(pc->status_key.account_id); - int j; - for (j = 0; j < MAX_INVENTORY; j++) + for (IOff0 j : IOff0::iter()) IFIX(pc->status.inventory[j].nameid); // cart is no longer supported // IFIX(pc->status.weapon); @@ -954,10 +952,12 @@ void ladmin_itemfrob_c2(dumb_ptr<block_list> bl, ItemNameId source_id, ItemNameI IFIX(pc->status.head_bottom); if (stor) - for (j = 0; j < stor->storage_amount; j++) + { + for (SOff0 j : SOff0::iter()) FIX(stor->storage_[j]); + } - for (j = 0; j < MAX_INVENTORY; j++) + for (IOff0 j : IOff0::iter()) { struct item_data *item = pc->inventory_data[j]; if (item && item->nameid == source_id) |