summaryrefslogtreecommitdiff
path: root/src/net/tmwa/beinghandler.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-02-22 13:02:26 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-02-22 14:32:45 +0100
commit81e4f170d8ba4ccbcfa1e6c07bd0522dfc3b6e08 (patch)
treee2619b16a5331e5760d94be389d0a3a01427293f /src/net/tmwa/beinghandler.cpp
parentd047db79f7034e0e75a85a656d18f40716d197b9 (diff)
downloadmana-81e4f170d8ba4ccbcfa1e6c07bd0522dfc3b6e08.tar.gz
mana-81e4f170d8ba4ccbcfa1e6c07bd0522dfc3b6e08.tar.bz2
mana-81e4f170d8ba4ccbcfa1e6c07bd0522dfc3b6e08.tar.xz
mana-81e4f170d8ba4ccbcfa1e6c07bd0522dfc3b6e08.zip
General code cleanups
* Use default member initializers * Use range-based loops * Don't use 'else' after 'return' * Removed some unused includes * Construct empty strings with std::string() instead of "" * Clear strings with .clear() instead of assigning "" * Check whether strings are empty with .empty() instead of comparing to "" * Removed redundant initializations
Diffstat (limited to 'src/net/tmwa/beinghandler.cpp')
-rw-r--r--src/net/tmwa/beinghandler.cpp19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index 4c7e18bb..50585970 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -410,18 +410,6 @@ void BeingHandler::handleMessage(MessageIn &msg)
case SMSG_BEING_CHANGE_LOOKS2:
{
- /*
- * SMSG_BEING_CHANGE_LOOKS (0x00c3) and
- * SMSG_BEING_CHANGE_LOOKS2 (0x01d7) do basically the same
- * thing. The difference is that ...LOOKS carries a single
- * 8 bit value, where ...LOOKS2 carries two 16 bit values.
- *
- * If type = 2, then the first 16 bit value is the weapon ID,
- * and the second 16 bit value is the shield ID. If no
- * shield is equipped, or type is not 2, then the second
- * 16 bit value will be 0.
- */
-
if (!(dstBeing = actorSpriteManager->findBeing(msg.readInt32())))
{
break;
@@ -472,7 +460,7 @@ void BeingHandler::handleMessage(MessageIn &msg)
dstBeing->setSprite(SPRITE_MISC2, id);
break;
default:
- logger->log("SMSG_BEING_CHANGE_LOOKS: unsupported type: "
+ logger->log("SMSG_BEING_CHANGE_LOOKS2: unsupported type: "
"%d, id: %d", type, id);
break;
}
@@ -530,12 +518,9 @@ void BeingHandler::handleMessage(MessageIn &msg)
break;
}
- if (Party *party = local_player->getParty()){
+ if (Party *party = local_player->getParty())
if (party->isMember(id))
- {
dstBeing->setParty(party);
- }
- }
// The original speed is ticks per tile * 10
if (speed)