summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-08-30 16:46:21 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-08-30 16:46:21 +0000
commit928fcf801f53d44d8b31b4285052a067340ab4ff (patch)
tree91f8b62b56467d63b1e6a4f49cecab63971dd43f /src/net
parentc8c4fd4850b543215faf4de83cc0f93c17b5a038 (diff)
downloadMana-928fcf801f53d44d8b31b4285052a067340ab4ff.tar.gz
Mana-928fcf801f53d44d8b31b4285052a067340ab4ff.tar.bz2
Mana-928fcf801f53d44d8b31b4285052a067340ab4ff.tar.xz
Mana-928fcf801f53d44d8b31b4285052a067340ab4ff.zip
Merged equipment database with items database and got rid of the unused item
art attribute. Removed the now unnecessary multiplication of weapon IDs with 10000. Added a fallback item icon and used it for unknown items or when an item image fails to load.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/beinghandler.cpp14
-rw-r--r--src/net/charserverhandler.cpp4
-rw-r--r--src/net/network.cpp2
3 files changed, 9 insertions, 11 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp
index c6e03c86..2c643a16 100644
--- a/src/net/beinghandler.cpp
+++ b/src/net/beinghandler.cpp
@@ -82,7 +82,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
dstBeing = beingManager->findBeing(id);
- if (dstBeing == NULL)
+ if (!dstBeing)
{
// Being with id >= 110000000 and job 0 are better
// known as ghosts, so don't create those.
@@ -108,7 +108,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
dstBeing->mJob = job;
dstBeing->setHairStyle(msg->readInt16());
dstBeing->setVisibleEquipment(
- Being::WEAPON_SPRITE, msg->readInt16() * 10000);
+ Being::WEAPON_SPRITE, msg->readInt16());
dstBeing->setVisibleEquipment(
Being::BOTTOMCLOTHES_SPRITE, msg->readInt16());
@@ -261,8 +261,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
dstBeing->setHairStyle(id);
break;
case 2:
- dstBeing->setVisibleEquipment(
- Being::WEAPON_SPRITE, id * 10000);
+ dstBeing->setVisibleEquipment(Being::WEAPON_SPRITE, id);
break;
case 3: // Change lower headgear for eAthena, pants for us
dstBeing->setVisibleEquipment(
@@ -280,7 +279,8 @@ void BeingHandler::handleMessage(MessageIn *msg)
dstBeing->setHairColor(id);
break;
default:
- logger->log("c3: %i\n", id); // unsupported
+ logger->log("SMSG_BEING_CHANGE_LOOKS: unsupported type: "
+ "%d, id: %d", type, id);
break;
}
}
@@ -306,7 +306,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
dstBeing = beingManager->findBeing(id);
- if (dstBeing == NULL)
+ if (!dstBeing)
{
dstBeing = beingManager->createBeing(id, job);
}
@@ -378,7 +378,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
case 0x0119:
// Change in players look
- logger->log("0x0119 %i %i %i %x %i\n", msg->readInt32(),
+ logger->log("0x0119 %i %i %i %x %i", msg->readInt32(),
msg->readInt16(), msg->readInt16(), msg->readInt16(),
msg->readInt8());
break;
diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp
index 9018b0af..a3f696c6 100644
--- a/src/net/charserverhandler.cpp
+++ b/src/net/charserverhandler.cpp
@@ -204,9 +204,7 @@ LocalPlayer* CharServerHandler::readPlayerData(MessageIn &msg, int &slot)
msg.readInt16(); // class
tempPlayer->setHairStyle(msg.readInt16());
Uint16 weapon = msg.readInt16();
- if (weapon == 11)
- weapon = 2;
- tempPlayer->setVisibleEquipment(Being::WEAPON_SPRITE, weapon * 10000);
+ tempPlayer->setVisibleEquipment(Being::WEAPON_SPRITE, weapon);
tempPlayer->mLevel = msg.readInt16();
msg.readInt16(); // skill point
tempPlayer->setVisibleEquipment(Being::BOTTOMCLOTHES_SPRITE, msg.readInt16()); // head bottom
diff --git a/src/net/network.cpp b/src/net/network.cpp
index c90e0201..fa5964d6 100644
--- a/src/net/network.cpp
+++ b/src/net/network.cpp
@@ -296,7 +296,7 @@ MessageIn Network::getNextMessage()
len = readWord(2);
#ifdef DEBUG
- logger->log("Received packet 0x%x of length %d\n", msgId, length);
+ logger->log("Received packet 0x%x of length %d", msgId, length);
#endif
MessageIn msg(mInBuffer, len);