From 3ce39d2b497ab5356290a22b324181386af51c51 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Tue, 5 Mar 2024 10:13:15 +0100 Subject: General code cleanups * Use final for all message handlers, Client, LocalPlayer, Being::getType, Being::setPosition and Being::setMap. (avoids some warnings about virtual dispatch in constructors) * Use auto in more places * Use emplace_back instead of push_back in some places * Use default member initializers * Less else after return * Removed superfluous .c_str() * Removed type aliases that are only used once * Removed more unused includes --- src/net/manaserv/charhandler.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/net/manaserv/charhandler.cpp') diff --git a/src/net/manaserv/charhandler.cpp b/src/net/manaserv/charhandler.cpp index 83919d4e..e7afa173 100644 --- a/src/net/manaserv/charhandler.cpp +++ b/src/net/manaserv/charhandler.cpp @@ -333,9 +333,8 @@ void CharHandler::newCharacter(const std::string &name, msg.writeInt8(gender); msg.writeInt8(slot); - std::vector::const_iterator it, it_end; - for (it = stats.begin(), it_end = stats.end(); it != it_end; it++) - msg.writeInt16((*it)); + for (int stat : stats) + msg.writeInt16(stat); accountServerConnection->send(msg); } -- cgit v1.2.3-70-g09d2