summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-29 17:45:52 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-29 17:45:52 +0300
commit2d32dc27210d16102f9200de115f2c3f79a5cb22 (patch)
tree5aa84ebe6c5c1d708b14bee2bf0ce95df714fc1d /src/net/eathena
parent7bdb50605562e47f1d6ae134881c09bd42293be5 (diff)
downloadmanaverse-2d32dc27210d16102f9200de115f2c3f79a5cb22.tar.gz
manaverse-2d32dc27210d16102f9200de115f2c3f79a5cb22.tar.bz2
manaverse-2d32dc27210d16102f9200de115f2c3f79a5cb22.tar.xz
manaverse-2d32dc27210d16102f9200de115f2c3f79a5cb22.zip
Use BeingTypeId in Being for subtypeid.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/beinghandler.cpp13
-rw-r--r--src/net/eathena/charserverhandler.cpp4
-rw-r--r--src/net/eathena/pethandler.cpp3
3 files changed, 11 insertions, 9 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index 9bc79c407..1b566edc7 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -460,7 +460,8 @@ Being *BeingHandler::createBeing2(Net::MessageIn &msg,
if (job == 45 && beingType == BeingType::NPC_EVENT)
type = ActorType::Portal;
- Being *const being = actorManager->createBeing(id, type, job);
+ Being *const being = actorManager->createBeing(
+ id, type, fromInt(job, BeingTypeId));
if (beingType == BeingType::MERSOL)
{
MercenaryInfo *const info = PlayerInfo::getMercenary();
@@ -524,7 +525,7 @@ void BeingHandler::processBeingChangeLookContinue(Net::MessageIn &msg,
switch (type)
{
case 0: // change race
- dstBeing->setSubtype(static_cast<uint16_t>(id),
+ dstBeing->setSubtype(fromInt(id, BeingTypeId),
dstBeing->getLook());
break;
case 1: // eAthena LOOK_HAIR
@@ -689,7 +690,7 @@ void BeingHandler::processBeingVisible(Net::MessageIn &msg)
speed = 150;
dstBeing->setWalkSpeed(Vector(speed, speed, 0));
- dstBeing->setSubtype(job, 0);
+ dstBeing->setSubtype(fromInt(job, BeingTypeId), 0);
if (dstBeing->getType() == ActorType::Monster && localPlayer)
localPlayer->checkNewName(dstBeing);
@@ -849,7 +850,7 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg)
speed = 150;
dstBeing->setWalkSpeed(Vector(speed, speed, 0));
- dstBeing->setSubtype(job, 0);
+ dstBeing->setSubtype(fromInt(job, BeingTypeId), 0);
if (dstBeing->getType() == ActorType::Monster && localPlayer)
localPlayer->checkNewName(dstBeing);
@@ -1019,7 +1020,7 @@ void BeingHandler::processBeingSpawn(Net::MessageIn &msg)
speed = 150;
dstBeing->setWalkSpeed(Vector(speed, speed, 0));
- dstBeing->setSubtype(job, 0);
+ dstBeing->setSubtype(fromInt(job, BeingTypeId), 0);
if (dstBeing->getType() == ActorType::Monster && localPlayer)
localPlayer->checkNewName(dstBeing);
@@ -1700,7 +1701,7 @@ void BeingHandler::processBeingFakeName(Net::MessageIn &msg)
msg.skip(4, "unsued");
Being *const dstBeing = createBeing2(msg, id, job, type);
- dstBeing->setSubtype(job, 0);
+ dstBeing->setSubtype(fromInt(job, BeingTypeId), 0);
dstBeing->setTileCoords(x, y);
dstBeing->setDirection(dir);
}
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index f94e3a34f..76005d968 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -201,7 +201,7 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg,
static_cast<LoginHandler*>(loginHandler)->getToken();
LocalPlayer *const tempPlayer = new LocalPlayer(
- msg.readBeingId("player id"), 0);
+ msg.readBeingId("player id"), BeingTypeId_zero);
tempPlayer->setGender(token.sex);
PlayerInfoBackend &data = character->data;
@@ -252,7 +252,7 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg,
color));
const uint16_t look = msg.readInt16("clothes color");
- tempPlayer->setSubtype(race, look);
+ tempPlayer->setSubtype(fromInt(race, BeingTypeId), look);
tempPlayer->setName(msg.readString(24, "name"));
character->dummy = tempPlayer;
diff --git a/src/net/eathena/pethandler.cpp b/src/net/eathena/pethandler.cpp
index 32f902e80..f89a6d53a 100644
--- a/src/net/eathena/pethandler.cpp
+++ b/src/net/eathena/pethandler.cpp
@@ -166,7 +166,8 @@ void PetHandler::processPetMessage(Net::MessageIn &msg)
if (!dstBeing)
return;
- const int hungry = data - (dstBeing->getSubType() - 100) * 100 - 50;
+ const int hungry = data - (toInt(dstBeing->getSubType(), int)
+ - 100) * 100 - 50;
if (hungry >= 0 && hungry <= 4)
{
if (localChatTab && localPlayer)