summaryrefslogtreecommitdiff
path: root/src/net/manaserv/beinghandler.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:07:54 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:07:54 +0100
commit5afe88df2538274859a162ffd63ed52118e80c19 (patch)
treeb610dfd58dc748fd63f49565b2a43eea2316714f /src/net/manaserv/beinghandler.cpp
parent73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (diff)
downloadmana-5afe88df2538274859a162ffd63ed52118e80c19.tar.gz
mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.bz2
mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.xz
mana-5afe88df2538274859a162ffd63ed52118e80c19.zip
Apply C++11 fixits
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
Diffstat (limited to 'src/net/manaserv/beinghandler.cpp')
-rw-r--r--src/net/manaserv/beinghandler.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/net/manaserv/beinghandler.cpp b/src/net/manaserv/beinghandler.cpp
index 61b4ef81..6be90d51 100644
--- a/src/net/manaserv/beinghandler.cpp
+++ b/src/net/manaserv/beinghandler.cpp
@@ -113,10 +113,10 @@ void BeingHandler::handleBeingEnterMessage(MessageIn &msg)
{
int type = msg.readInt8();
int id = msg.readInt16();
- Being::Action action = (Being::Action)msg.readInt8();
+ auto action = (Being::Action)msg.readInt8();
int px = msg.readInt16();
int py = msg.readInt16();
- BeingDirection direction = (BeingDirection)msg.readInt8();
+ auto direction = (BeingDirection)msg.readInt8();
Gender gender;
int genderAsInt = msg.readInt8();
if (genderAsInt == ::GENDER_FEMALE)
@@ -241,7 +241,7 @@ void BeingHandler::handleBeingsMoveMessage(MessageIn &msg)
void BeingHandler::handleBeingAttackMessage(MessageIn &msg)
{
Being *being = actorSpriteManager->findBeing(msg.readInt16());
- const BeingDirection direction = (BeingDirection) msg.readInt8();
+ const auto direction = (BeingDirection) msg.readInt8();
const int attackId = msg.readInt8();
if (!being)
@@ -260,7 +260,7 @@ void BeingHandler::handleBeingsDamageMessage(MessageIn &msg)
int damage = msg.readInt16();
if (being)
{
- being->takeDamage(0, damage, Being::HIT);
+ being->takeDamage(nullptr, damage, Being::HIT);
}
}
}
@@ -268,7 +268,7 @@ void BeingHandler::handleBeingsDamageMessage(MessageIn &msg)
void BeingHandler::handleBeingActionChangeMessage(MessageIn &msg)
{
Being *being = actorSpriteManager->findBeing(msg.readInt16());
- Being::Action action = (Being::Action) msg.readInt8();
+ auto action = (Being::Action) msg.readInt8();
if (!being)
return;
@@ -299,7 +299,7 @@ void BeingHandler::handleBeingActionChangeMessage(MessageIn &msg)
};
std::string message(deadMsg[rand()%13]);
message.append(std::string(" ") + _("Press OK to respawn."));
- OkDialog *dlg = new OkDialog(_("You Died"), message, false);
+ auto *dlg = new OkDialog(_("You Died"), message, false);
dlg->addActionListener(&(ManaServ::respawnListener));
}
}