diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-06-11 21:55:13 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-06-11 23:27:33 -0700 |
commit | 8b5370313dcc00a45ea5c3e8b4c497bc00fd8e13 (patch) | |
tree | 15e8a4841af992e17794f26fc7991ed40c35bd51 /src/map/trade.cpp | |
parent | 8c6072df499ef9068346fbe8313b63dbba1e4e82 (diff) | |
download | tmwa-8b5370313dcc00a45ea5c3e8b4c497bc00fd8e13.tar.gz tmwa-8b5370313dcc00a45ea5c3e8b4c497bc00fd8e13.tar.bz2 tmwa-8b5370313dcc00a45ea5c3e8b4c497bc00fd8e13.tar.xz tmwa-8b5370313dcc00a45ea5c3e8b4c497bc00fd8e13.zip |
Allegedly remove all manual memory management
Diffstat (limited to 'src/map/trade.cpp')
-rw-r--r-- | src/map/trade.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/map/trade.cpp b/src/map/trade.cpp index ff54caa..c0f8c46 100644 --- a/src/map/trade.cpp +++ b/src/map/trade.cpp @@ -108,7 +108,7 @@ void trade_tradeadditem(dumb_ptr<map_session_data> sd, int index, int amount) struct item_data *id; int trade_i; int trade_weight = 0; - int free = 0; + int free_ = 0; int c; int i; @@ -133,7 +133,7 @@ void trade_tradeadditem(dumb_ptr<map_session_data> sd, int index, int amount) { if (target_sd->status.inventory[i].nameid == 0 && target_sd->inventory_data[i] == NULL) - free++; + free_++; } for (trade_i = 0; trade_i < 10; trade_i++) { @@ -156,7 +156,7 @@ void trade_tradeadditem(dumb_ptr<map_session_data> sd, int index, int amount) && id->type != ItemType::_7 && id->type != ItemType::_8) { - free++; + free_++; break; } } @@ -167,7 +167,7 @@ void trade_tradeadditem(dumb_ptr<map_session_data> sd, int index, int amount) { clif_tradeitemok(sd, index, 0, 1); //fail to add item -- the player was over weighted. } - else if (free <= 0) + else if (free_ <= 0) { clif_tradeitemok(sd, index, 0, 2); //fail to add item -- no free slots at receiver } @@ -210,14 +210,14 @@ void trade_tradeadditem(dumb_ptr<map_session_data> sd, int index, int amount) && id->type != ItemType::_7 && id->type != ItemType::_8) { - free++; + free_++; break; } } } } // used a slot, but might be cancelled out by stackable checks above - free--; + free_--; } } } |