summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-27 15:56:15 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-27 15:56:15 +0300
commit9cc52ed1177302c5f43b1eac165a23548f256499 (patch)
tree6bf2adfb938a85ff40afff4a40913476e937aa42 /src/net/eathena
parent735a152850846b203a3696c6644cf299f2093196 (diff)
downloadmanaverse-9cc52ed1177302c5f43b1eac165a23548f256499.tar.gz
manaverse-9cc52ed1177302c5f43b1eac165a23548f256499.tar.bz2
manaverse-9cc52ed1177302c5f43b1eac165a23548f256499.tar.xz
manaverse-9cc52ed1177302c5f43b1eac165a23548f256499.zip
Fix spawn of disguised mobs.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/beinghandler.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index 71a098510..633dfff56 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -438,6 +438,9 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
statusEffects |= (static_cast<uint32_t>(msg.readInt16()))
<< 16; // status.options; Aethyra uses this as misc2
const int16_t job = msg.readInt16();
+ int disguiseId = 0;
+ if (id < 110000000 && job >= 1000)
+ disguiseId = job;
Being *dstBeing = actorSpriteManager->findBeing(id);
@@ -451,6 +454,12 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
if (!dstBeing)
return;
}
+ else if (disguiseId)
+ {
+ actorSpriteManager->undelete(dstBeing);
+ if (serverVersion < 1)
+ requestNameById(id);
+ }
uint8_t dir = dstBeing->getDirectionDelayed();
if (dir)
@@ -502,16 +511,18 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
// reserving bit for future usage
dstBeing->setGender(Being::intToGender(msg.readInt8() & 3));
- // Set these after the gender, as the sprites may be gender-specific
- dstBeing->setSprite(SPRITE_WEAPON, weapon, "", 1, true);
- if (!mHideShield)
- dstBeing->setSprite(SPRITE_SHIELD, shield);
- dstBeing->setSprite(SPRITE_BOTTOMCLOTHES, headBottom);
- dstBeing->setSprite(SPRITE_TOPCLOTHES, headMid);
- dstBeing->setSprite(SPRITE_HAT, headTop);
- dstBeing->setSprite(SPRITE_HAIR, hairStyle * -1,
- ItemDB::get(-hairStyle).getDyeColorsString(hairColor));
-
+ if (!disguiseId)
+ {
+ // Set these after the gender, as the sprites may be gender-specific
+ dstBeing->setSprite(SPRITE_WEAPON, weapon, "", 1, true);
+ if (!mHideShield)
+ dstBeing->setSprite(SPRITE_SHIELD, shield);
+ dstBeing->setSprite(SPRITE_BOTTOMCLOTHES, headBottom);
+ dstBeing->setSprite(SPRITE_TOPCLOTHES, headMid);
+ dstBeing->setSprite(SPRITE_HAT, headTop);
+ dstBeing->setSprite(SPRITE_HAIR, hairStyle * -1,
+ ItemDB::get(-hairStyle).getDyeColorsString(hairColor));
+ }
player_node->imitateOutfit(dstBeing);
if (msgType == 3)