summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-08 14:30:28 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-08 14:30:28 +0300
commitc9a31afec60a5085e0a3dbd26c15db397730a768 (patch)
tree08fe6126f1c1405a62be00425601613f19841601 /src/net
parentc43a3b024bf3da2b0c7b6eb177b662d63db41808 (diff)
downloadmanaverse-c9a31afec60a5085e0a3dbd26c15db397730a768.tar.gz
manaverse-c9a31afec60a5085e0a3dbd26c15db397730a768.tar.bz2
manaverse-c9a31afec60a5085e0a3dbd26c15db397730a768.tar.xz
manaverse-c9a31afec60a5085e0a3dbd26c15db397730a768.zip
Add strong typed bool IsWeapon.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ea/beingrecv.cpp2
-rw-r--r--src/net/ea/beingrecv.h3
-rw-r--r--src/net/eathena/beingrecv.cpp30
-rw-r--r--src/net/eathena/charserverrecv.cpp6
-rw-r--r--src/net/tmwa/beingrecv.cpp40
-rw-r--r--src/net/tmwa/charserverrecv.cpp6
6 files changed, 68 insertions, 19 deletions
diff --git a/src/net/ea/beingrecv.cpp b/src/net/ea/beingrecv.cpp
index 7b8d74328..154243258 100644
--- a/src/net/ea/beingrecv.cpp
+++ b/src/net/ea/beingrecv.cpp
@@ -547,7 +547,7 @@ void BeingRecv::setSprite(Being *const being,
const int id,
const std::string &color,
const ItemColor colorId,
- const bool isWeapon,
+ const IsWeapon isWeapon,
const bool isTempSprite)
{
if (!being)
diff --git a/src/net/ea/beingrecv.h b/src/net/ea/beingrecv.h
index 9c98ba12e..f68d87880 100644
--- a/src/net/ea/beingrecv.h
+++ b/src/net/ea/beingrecv.h
@@ -24,6 +24,7 @@
#define NET_EA_BEINGRECV_H
#include "enums/simpletypes/beingid.h"
+#include "enums/simpletypes/isweapon.h"
#include "enums/simpletypes/itemcolor.h"
#include <string>
@@ -57,7 +58,7 @@ namespace Ea
const int id,
const std::string &color = "",
const ItemColor colorId = ItemColor_one,
- const bool isWeapon = false,
+ const IsWeapon isWeapon = IsWeapon_false,
const bool isTempSprite = false);
} // namespace BeingRecv
} // namespace Ea
diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp
index 5d4c59d00..07779147a 100644
--- a/src/net/eathena/beingrecv.cpp
+++ b/src/net/eathena/beingrecv.cpp
@@ -160,7 +160,11 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg,
dstBeing->setSpriteID(SPRITE_HAIR_COLOR, id * -1);
break;
case 2: // LOOK_WEAPON Weapon ID in id, Shield ID in id2
- dstBeing->setSprite(SPRITE_BODY, id, "", itemColor, true);
+ dstBeing->setSprite(SPRITE_BODY,
+ id,
+ "",
+ itemColor,
+ IsWeapon_true);
dstBeing->setSprite(SPRITE_FLOOR, id2);
if (localPlayer)
localPlayer->imitateOutfit(dstBeing, SPRITE_FLOOR);
@@ -399,8 +403,12 @@ void BeingRecv::processBeingVisible(Net::MessageIn &msg)
Ea::BeingRecv::setSprite(dstBeing, SPRITE_CLOTHES_COLOR, headTop);
Ea::BeingRecv::setSprite(dstBeing, SPRITE_HAIR, shoes);
Ea::BeingRecv::setSprite(dstBeing, SPRITE_SHOES, gloves);
- Ea::BeingRecv::setSprite(dstBeing, SPRITE_BODY, weapon, "",
- ItemColor_one, true);
+ Ea::BeingRecv::setSprite(dstBeing,
+ SPRITE_BODY,
+ weapon,
+ "",
+ ItemColor_one,
+ IsWeapon_true);
// Ea::BeingRecv::setSprite(dstBeing, SPRITE_FLOOR, shield);
}
else if (dstBeing->getType() == ActorType::Npc
@@ -601,8 +609,12 @@ void BeingRecv::processBeingMove(Net::MessageIn &msg)
Ea::BeingRecv::setSprite(dstBeing, SPRITE_CLOTHES_COLOR, headTop);
Ea::BeingRecv::setSprite(dstBeing, SPRITE_HAIR, shoes);
Ea::BeingRecv::setSprite(dstBeing, SPRITE_SHOES, gloves);
- Ea::BeingRecv::setSprite(dstBeing, SPRITE_BODY, weapon, "",
- ItemColor_one, true);
+ Ea::BeingRecv::setSprite(dstBeing,
+ SPRITE_BODY,
+ weapon,
+ "",
+ ItemColor_one,
+ IsWeapon_true);
}
// Ea::BeingRecv::setSprite(dstBeing, SPRITE_FLOOR, shield);
}
@@ -801,8 +813,12 @@ void BeingRecv::processBeingSpawn(Net::MessageIn &msg)
Ea::BeingRecv::setSprite(dstBeing, SPRITE_CLOTHES_COLOR, headTop);
Ea::BeingRecv::setSprite(dstBeing, SPRITE_HAIR, shoes);
Ea::BeingRecv::setSprite(dstBeing, SPRITE_SHOES, gloves);
- Ea::BeingRecv::setSprite(dstBeing, SPRITE_BODY, weapon, "",
- ItemColor_one, true);
+ Ea::BeingRecv::setSprite(dstBeing,
+ SPRITE_BODY,
+ weapon,
+ "",
+ ItemColor_one,
+ IsWeapon_true);
// Ea::BeingRecv::setSprite(dstBeing, SPRITE_FLOOR, shield);
}
else if (dstBeing->getType() == ActorType::Npc
diff --git a/src/net/eathena/charserverrecv.cpp b/src/net/eathena/charserverrecv.cpp
index fcf90acc9..598602355 100644
--- a/src/net/eathena/charserverrecv.cpp
+++ b/src/net/eathena/charserverrecv.cpp
@@ -129,7 +129,11 @@ void CharServerRecv::readPlayerData(Net::MessageIn &msg,
const int option A_UNUSED = (msg.readInt16("weapon") | 1) ^ 1;
const int weapon = 0;
- tempPlayer->setSprite(SPRITE_BODY, weapon, "", ItemColor_one, true);
+ tempPlayer->setSprite(SPRITE_BODY,
+ weapon,
+ "",
+ ItemColor_one,
+ IsWeapon_true);
data.mAttributes[Attributes::LEVEL] = msg.readInt16("level");
diff --git a/src/net/tmwa/beingrecv.cpp b/src/net/tmwa/beingrecv.cpp
index cb5eefd92..5eec60985 100644
--- a/src/net/tmwa/beingrecv.cpp
+++ b/src/net/tmwa/beingrecv.cpp
@@ -143,7 +143,11 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg,
break;
}
case 2: // Weapon ID in id, Shield ID in id2
- dstBeing->setSprite(SPRITE_BODY, id, "", ItemColor_one, true);
+ dstBeing->setSprite(SPRITE_BODY,
+ id,
+ "",
+ ItemColor_one,
+ IsWeapon_true);
dstBeing->setSprite(SPRITE_FLOOR, id2);
localPlayer->imitateOutfit(dstBeing, SPRITE_FLOOR);
break;
@@ -311,7 +315,11 @@ void BeingRecv::processPlayerUpdate1(Net::MessageIn &msg)
if (!disguiseId)
{
// Set these after the gender, as the sprites may be gender-specific
- dstBeing->updateSprite(SPRITE_BODY, weapon, "", ItemColor_one, true);
+ dstBeing->updateSprite(SPRITE_BODY,
+ weapon,
+ "",
+ ItemColor_one,
+ IsWeapon_true);
dstBeing->updateSprite(SPRITE_FLOOR, shield);
dstBeing->updateSprite(SPRITE_WEAPON, headBottom);
dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid);
@@ -453,7 +461,11 @@ void BeingRecv::processPlayerUpdate2(Net::MessageIn &msg)
if (!disguiseId)
{
// Set these after the gender, as the sprites may be gender-specific
- dstBeing->updateSprite(SPRITE_BODY, weapon, "", ItemColor_one, true);
+ dstBeing->updateSprite(SPRITE_BODY,
+ weapon,
+ "",
+ ItemColor_one,
+ IsWeapon_true);
dstBeing->updateSprite(SPRITE_FLOOR, shield);
dstBeing->updateSprite(SPRITE_WEAPON, headBottom);
dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid);
@@ -595,7 +607,11 @@ void BeingRecv::processPlayerMove(Net::MessageIn &msg)
if (!disguiseId)
{
// Set these after the gender, as the sprites may be gender-specific
- dstBeing->updateSprite(SPRITE_BODY, weapon, "", ItemColor_one, true);
+ dstBeing->updateSprite(SPRITE_BODY,
+ weapon,
+ "",
+ ItemColor_one,
+ IsWeapon_true);
dstBeing->updateSprite(SPRITE_FLOOR, shield);
dstBeing->updateSprite(SPRITE_WEAPON, headBottom);
dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid);
@@ -844,8 +860,12 @@ void BeingRecv::processBeingVisible(Net::MessageIn &msg)
Ea::BeingRecv::setSprite(dstBeing, SPRITE_CLOTHES_COLOR, headTop);
Ea::BeingRecv::setSprite(dstBeing, SPRITE_HAIR, shoes);
Ea::BeingRecv::setSprite(dstBeing, SPRITE_SHOES, gloves);
- Ea::BeingRecv::setSprite(dstBeing, SPRITE_BODY, weapon, "",
- ItemColor_one, true);
+ Ea::BeingRecv::setSprite(dstBeing,
+ SPRITE_BODY,
+ weapon,
+ "",
+ ItemColor_one,
+ IsWeapon_true);
Ea::BeingRecv::setSprite(dstBeing, SPRITE_FLOOR, shield);
}
else if (dstBeing->getType() == ActorType::Npc
@@ -1057,8 +1077,12 @@ void BeingRecv::processBeingMove(Net::MessageIn &msg)
Ea::BeingRecv::setSprite(dstBeing, SPRITE_CLOTHES_COLOR, headTop);
Ea::BeingRecv::setSprite(dstBeing, SPRITE_HAIR, shoes);
Ea::BeingRecv::setSprite(dstBeing, SPRITE_SHOES, gloves);
- Ea::BeingRecv::setSprite(dstBeing, SPRITE_BODY, weapon, "",
- ItemColor_one, true);
+ Ea::BeingRecv::setSprite(dstBeing,
+ SPRITE_BODY,
+ weapon,
+ "",
+ ItemColor_one,
+ IsWeapon_true);
Ea::BeingRecv::setSprite(dstBeing, SPRITE_FLOOR, shield);
}
else if (dstBeing->getType() == ActorType::Npc
diff --git a/src/net/tmwa/charserverrecv.cpp b/src/net/tmwa/charserverrecv.cpp
index 428693678..18c0ab791 100644
--- a/src/net/tmwa/charserverrecv.cpp
+++ b/src/net/tmwa/charserverrecv.cpp
@@ -104,7 +104,11 @@ void CharServerRecv::readPlayerData(Net::MessageIn &msg,
const uint16_t look = msg.readUInt8("look");
tempPlayer->setSubtype(fromInt(race, BeingTypeId), look);
const uint16_t weapon = msg.readInt16("weapon");
- tempPlayer->setSprite(SPRITE_BODY, weapon, "", ItemColor_one, true);
+ tempPlayer->setSprite(SPRITE_BODY,
+ weapon,
+ "",
+ ItemColor_one,
+ IsWeapon_true);
data.mAttributes[Attributes::LEVEL] = msg.readInt16("level");