summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/inventoryhandler.h3
-rw-r--r--src/net/eathena/inventoryrecv.cpp1
-rw-r--r--src/net/eathena/vendingrecv.cpp2
-rw-r--r--src/net/tmwa/inventoryhandler.h3
-rw-r--r--src/utils/chatutils_unittest.cc16
-rw-r--r--src/utils/timer_unittest.cc6
6 files changed, 17 insertions, 14 deletions
diff --git a/src/net/eathena/inventoryhandler.h b/src/net/eathena/inventoryhandler.h
index 8f144f57e..786917970 100644
--- a/src/net/eathena/inventoryhandler.h
+++ b/src/net/eathena/inventoryhandler.h
@@ -71,7 +71,8 @@ class InventoryHandler final : public Ea::InventoryHandler
void identifyItem(const Item *const item) const override final;
- void mergeItemsAck(const std::vector<Item*> &items) const override final;
+ void mergeItemsAck(const std::vector<Item*> &items) const
+ override final;
void mergetItemsCancel() const override final;
diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp
index c3f752a6d..5ba7a81b3 100644
--- a/src/net/eathena/inventoryrecv.cpp
+++ b/src/net/eathena/inventoryrecv.cpp
@@ -1057,7 +1057,6 @@ void InventoryRecv::processPlayerCartEquip(Net::MessageIn &msg)
void InventoryRecv::processPlayerCartItems(Net::MessageIn &msg)
{
-//+++
BLOCK_START("InventoryRecv::processPlayerCartItems")
Ea::InventoryRecv::mInventoryItems.clear();
diff --git a/src/net/eathena/vendingrecv.cpp b/src/net/eathena/vendingrecv.cpp
index 4c609a766..4a342d8eb 100644
--- a/src/net/eathena/vendingrecv.cpp
+++ b/src/net/eathena/vendingrecv.cpp
@@ -89,7 +89,7 @@ void VendingRecv::processItemsList(Net::MessageIn &msg)
if (msg.getVersion() >= 20100105)
offset += 4;
- const int count = (msg.readInt16("len") - offset) / 22;
+ const int count = (msg.readInt16("len") - offset) / packetLen;
const BeingId id = msg.readBeingId("id");
const Being *const being = actorManager->findBeing(id);
if (!being)
diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h
index dfd2776da..1bbbf0f3b 100644
--- a/src/net/tmwa/inventoryhandler.h
+++ b/src/net/tmwa/inventoryhandler.h
@@ -71,7 +71,8 @@ class InventoryHandler final : public Ea::InventoryHandler
void identifyItem(const Item *const item) const override final;
- void mergeItemsAck(const std::vector<Item*> &items) const override final;
+ void mergeItemsAck(const std::vector<Item*> &items) const
+ override final;
void mergetItemsCancel() const override final;
diff --git a/src/utils/chatutils_unittest.cc b/src/utils/chatutils_unittest.cc
index 31889b76c..74a62c811 100644
--- a/src/utils/chatutils_unittest.cc
+++ b/src/utils/chatutils_unittest.cc
@@ -88,7 +88,7 @@ TEST_CASE("chatutils replaceVars")
SECTION("monster")
{
- Being *monster = new Being(static_cast<BeingId>(3),
+ Being *const monster = new Being(static_cast<BeingId>(3),
ActorType::Monster,
BeingTypeId_zero,
nullptr);
@@ -110,7 +110,7 @@ TEST_CASE("chatutils replaceVars")
replaceVars(str);
REQUIRE(str == "test ");
- Being *player1 = new Being(static_cast<BeingId>(2),
+ Being *const player1 = new Being(static_cast<BeingId>(2),
ActorType::Player,
BeingTypeId_zero,
nullptr);
@@ -121,7 +121,7 @@ TEST_CASE("chatutils replaceVars")
replaceVars(str);
REQUIRE(str == "test player1");
- Being *player2 = new Being(static_cast<BeingId>(4),
+ Being *const player2 = new Being(static_cast<BeingId>(4),
ActorType::Player,
BeingTypeId_zero,
nullptr);
@@ -139,14 +139,14 @@ TEST_CASE("chatutils replaceVars")
{
actorManager->mActors.insert(localPlayer);
- Party *party1 = Party::getParty(1);
+ Party *const party1 = Party::getParty(1);
localPlayer->setParty(party1);
str = "test <PARTY>";
replaceVars(str);
REQUIRE(str == "test ");
- Being *player1 = new Being(static_cast<BeingId>(2),
+ Being *const player1 = new Being(static_cast<BeingId>(2),
ActorType::Player,
BeingTypeId_zero,
nullptr);
@@ -158,7 +158,7 @@ TEST_CASE("chatutils replaceVars")
replaceVars(str);
REQUIRE(str == "test player1");
- Being *player2 = new Being(static_cast<BeingId>(4),
+ Being *const player2 = new Being(static_cast<BeingId>(4),
ActorType::Player,
BeingTypeId_zero,
nullptr);
@@ -170,9 +170,9 @@ TEST_CASE("chatutils replaceVars")
replaceVars(str);
REQUIRE(str == "test player1,player2");
- Party *party2 = Party::getParty(2);
+ Party *const party2 = Party::getParty(2);
- Being *player3 = new Being(static_cast<BeingId>(5),
+ Being *const player3 = new Being(static_cast<BeingId>(5),
ActorType::Player,
BeingTypeId_zero,
nullptr);
diff --git a/src/utils/timer_unittest.cc b/src/utils/timer_unittest.cc
index 3855d6e70..c7fc2a275 100644
--- a/src/utils/timer_unittest.cc
+++ b/src/utils/timer_unittest.cc
@@ -51,13 +51,15 @@ TEST_CASE("timer get_elapsed_time")
tick_time = 10;
REQUIRE(get_elapsed_time(0) == 10 * MILLISECONDS_IN_A_TICK);
REQUIRE(get_elapsed_time(10) == 0 * MILLISECONDS_IN_A_TICK);
- REQUIRE(get_elapsed_time(MAX_TICK_VALUE - 1) == 11 * MILLISECONDS_IN_A_TICK);
+ REQUIRE(get_elapsed_time(MAX_TICK_VALUE - 1) ==
+ 11 * MILLISECONDS_IN_A_TICK);
tick_time = 10000;
REQUIRE(get_elapsed_time(0) == 10000 * MILLISECONDS_IN_A_TICK);
REQUIRE(get_elapsed_time(10) == 9990 * MILLISECONDS_IN_A_TICK);
REQUIRE(get_elapsed_time(10000) == 0 * MILLISECONDS_IN_A_TICK);
- REQUIRE(get_elapsed_time(MAX_TICK_VALUE - 1) == 10001 * MILLISECONDS_IN_A_TICK);
+ REQUIRE(get_elapsed_time(MAX_TICK_VALUE - 1) ==
+ 10001 * MILLISECONDS_IN_A_TICK);
}
TEST_CASE("timer get_elapsed_time1")