summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-08 22:44:39 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-08 22:44:39 +0300
commita61ac4664d55cddb18d2d861e76629bd07676129 (patch)
tree59f5ba3ff7e65bbe94651db9ad2cf68b847d8f96 /src/net/eathena
parentbb3a85b045a6135f7228023a7ba55fb1c9e6bd90 (diff)
downloadplus-a61ac4664d55cddb18d2d861e76629bd07676129.tar.gz
plus-a61ac4664d55cddb18d2d861e76629bd07676129.tar.bz2
plus-a61ac4664d55cddb18d2d861e76629bd07676129.tar.xz
plus-a61ac4664d55cddb18d2d861e76629bd07676129.zip
Add some missing const.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/buyingstorehandler.cpp2
-rw-r--r--src/net/eathena/buyingstorehandler.h2
-rw-r--r--src/net/eathena/cashshophandler.cpp3
-rw-r--r--src/net/eathena/cashshophandler.h2
-rw-r--r--src/net/eathena/markethandler.cpp8
-rw-r--r--src/net/eathena/markethandler.h3
-rw-r--r--src/net/eathena/npchandler.h3
-rw-r--r--src/net/eathena/vendinghandler.cpp2
-rw-r--r--src/net/eathena/vendinghandler.h3
9 files changed, 16 insertions, 12 deletions
diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp
index 5fcc9c4aa..88928183c 100644
--- a/src/net/eathena/buyingstorehandler.cpp
+++ b/src/net/eathena/buyingstorehandler.cpp
@@ -45,7 +45,7 @@ BuyingStoreHandler::BuyingStoreHandler()
void BuyingStoreHandler::create(const std::string &name,
const int maxMoney,
const bool flag,
- std::vector<ShopItem*> &items) const
+ const std::vector<ShopItem*> &items) const
{
createOutPacket(CMSG_BUYINGSTORE_CREATE);
outMsg.writeInt16(CAST_S16(89 + items.size() * 8), "len");
diff --git a/src/net/eathena/buyingstorehandler.h b/src/net/eathena/buyingstorehandler.h
index 026d80306..f271dc60d 100644
--- a/src/net/eathena/buyingstorehandler.h
+++ b/src/net/eathena/buyingstorehandler.h
@@ -37,7 +37,7 @@ class BuyingStoreHandler final : public Net::BuyingStoreHandler
void create(const std::string &name,
const int maxMoney,
const bool flag,
- std::vector<ShopItem*> &items) const override final;
+ const std::vector<ShopItem*> &items) const override final;
void close() const override final;
diff --git a/src/net/eathena/cashshophandler.cpp b/src/net/eathena/cashshophandler.cpp
index 026297673..56b6b3fbf 100644
--- a/src/net/eathena/cashshophandler.cpp
+++ b/src/net/eathena/cashshophandler.cpp
@@ -50,7 +50,8 @@ void CashShopHandler::buyItem(const int points,
outMsg.writeInt16(CAST_S16(itemId), "item id");
}
-void CashShopHandler::buyItems(std::vector<ShopItem*> &items A_UNUSED) const
+void CashShopHandler::buyItems(const std::vector<ShopItem*> &items A_UNUSED)
+ const
{
// +++ probably need impliment buy many items at same time
}
diff --git a/src/net/eathena/cashshophandler.h b/src/net/eathena/cashshophandler.h
index d6a1e2f14..7d7fe1fbc 100644
--- a/src/net/eathena/cashshophandler.h
+++ b/src/net/eathena/cashshophandler.h
@@ -39,7 +39,7 @@ class CashShopHandler final : public Net::CashShopHandler
const ItemColor color,
const int amount) const override final;
- void buyItems(std::vector<ShopItem*> &items) const override final
+ void buyItems(const std::vector<ShopItem*> &items) const override final
A_CONST;
void close() const override final;
diff --git a/src/net/eathena/markethandler.cpp b/src/net/eathena/markethandler.cpp
index b055d574a..c019c6251 100644
--- a/src/net/eathena/markethandler.cpp
+++ b/src/net/eathena/markethandler.cpp
@@ -64,14 +64,14 @@ void MarketHandler::buyItem(const int itemId,
}
}
-void MarketHandler::buyItems(std::vector<ShopItem*> &items) const
+void MarketHandler::buyItems(const std::vector<ShopItem*> &items) const
{
int cnt = 0;
const int pairSize = 6;
- FOR_EACH (std::vector<ShopItem*>::iterator, it, items)
+ FOR_EACH (std::vector<ShopItem*>::const_iterator, it, items)
{
- ShopItem *const item = *it;
+ const ShopItem *const item = *it;
const int usedQuantity = item->getUsedQuantity();
const int type = item->getType();
if (!usedQuantity)
@@ -87,7 +87,7 @@ void MarketHandler::buyItems(std::vector<ShopItem*> &items) const
createOutPacket(CMSG_NPC_MARKET_BUY);
outMsg.writeInt16(CAST_S16(4 + pairSize * cnt), "len");
- FOR_EACH (std::vector<ShopItem*>::iterator, it, items)
+ FOR_EACH (std::vector<ShopItem*>::const_iterator, it, items)
{
ShopItem *const item = *it;
const int usedQuantity = item->getUsedQuantity();
diff --git a/src/net/eathena/markethandler.h b/src/net/eathena/markethandler.h
index 797ed28bd..e99aa6bc9 100644
--- a/src/net/eathena/markethandler.h
+++ b/src/net/eathena/markethandler.h
@@ -40,7 +40,8 @@ class MarketHandler final : public Net::MarketHandler
const ItemColor color,
const int amount) const override final;
- void buyItems(std::vector<ShopItem*> &items) const override final;
+ void buyItems(const std::vector<ShopItem*> &items) const
+ override final;
};
} // namespace EAthena
diff --git a/src/net/eathena/npchandler.h b/src/net/eathena/npchandler.h
index 5a718fe98..049d69a72 100644
--- a/src/net/eathena/npchandler.h
+++ b/src/net/eathena/npchandler.h
@@ -59,7 +59,8 @@ class NpcHandler final : public Ea::NpcHandler
const ItemColor color,
const int amount) const override final;
- void buyItems(std::vector<ShopItem*> &items) const override final;
+ void buyItems(std::vector<ShopItem*> &items) const
+ override final;
void sellItem(const BeingId beingId,
const int itemId,
diff --git a/src/net/eathena/vendinghandler.cpp b/src/net/eathena/vendinghandler.cpp
index ce2b8d384..739f39acd 100644
--- a/src/net/eathena/vendinghandler.cpp
+++ b/src/net/eathena/vendinghandler.cpp
@@ -91,7 +91,7 @@ void VendingHandler::buy2(const Being *const being,
void VendingHandler::createShop(const std::string &name,
const bool flag,
- std::vector<ShopItem*> &items) const
+ const std::vector<ShopItem*> &items) const
{
createOutPacket(CMSG_VENDING_CREATE_SHOP);
outMsg.writeInt16(CAST_S16(85 + items.size() * 8), "len");
diff --git a/src/net/eathena/vendinghandler.h b/src/net/eathena/vendinghandler.h
index 531b5f5ec..b824a8d8e 100644
--- a/src/net/eathena/vendinghandler.h
+++ b/src/net/eathena/vendinghandler.h
@@ -47,7 +47,8 @@ class VendingHandler final : public Net::VendingHandler
void createShop(const std::string &name,
const bool flag,
- std::vector<ShopItem*> &items) const override final;
+ const std::vector<ShopItem*> &items) const
+ override final;
};
} // namespace EAthena