summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/being/being.cpp35
-rw-r--r--src/being/being.h9
-rw-r--r--src/net/eathena/beingrecv.cpp11
3 files changed, 53 insertions, 2 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 6bbf50a48..4f115a6d3 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -2875,7 +2875,6 @@ void Being::setSpriteColor(const unsigned int slot,
CompoundSprite::setSprite(slot, equipmentSprite);
mSpriteDraw[slot] = id;
-
addItemParticles(id, info.getDisplay());
setAction(mAction, 0);
@@ -3224,6 +3223,15 @@ void Being::setHairTempSprite(const unsigned int slot,
void Being::setHairColorSpriteID(const unsigned int slot,
const int id) restrict2
{
+ if (charServerHandler == nullptr || slot >= charServerHandler->maxSprite())
+ return;
+
+ if (slot >= CAST_U32(mSprites.size()))
+ ensureSize(slot + 1);
+
+ if (slot >= CAST_U32(mSlots.size()))
+ mSlots.resize(slot + 1, BeingSlot());
+
BeingSlot &beingSlot = mSlots[slot];
setSpriteColor(slot,
id,
@@ -3688,6 +3696,18 @@ void Being::drawOther(Graphics *restrict const graphics,
drawOtherSpriteAt(graphics, px, py);
}
+void Being::drawNpc(Graphics *restrict const graphics,
+ const int offsetX,
+ const int offsetY) const restrict2
+{
+ // getActorX() + offsetX;
+ const int px = mPixelX - mapTileSize / 2 + offsetX;
+ // getActorY() + offsetY;
+ const int py = mPixelY - mapTileSize + offsetY;
+ drawBeingCursor(graphics, px, py);
+ drawNpcSpriteAt(graphics, px, py);
+}
+
void Being::drawMonster(Graphics *restrict const graphics,
const int offsetX,
const int offsetY) const restrict2
@@ -3783,10 +3803,14 @@ void Being::draw(Graphics *restrict const graphics,
offsetX,
offsetY);
break;
+ case ActorType::Npc:
+ drawNpc(graphics,
+ offsetX,
+ offsetY);
+ break;
case ActorType::Pet:
case ActorType::SkillUnit:
case ActorType::Unknown:
- case ActorType::Npc:
case ActorType::FloorItem:
case ActorType::Avatar:
default:
@@ -3902,6 +3926,13 @@ void Being::drawOtherSpriteAt(Graphics *restrict const graphics,
CompoundSprite::drawSimple(graphics, x, y);
}
+void Being::drawNpcSpriteAt(Graphics *restrict const graphics,
+ const int x,
+ const int y) const restrict2
+{
+ drawCompound(graphics, x, y);
+}
+
void Being::drawMonsterSpriteAt(Graphics *restrict const graphics,
const int x,
const int y) const restrict2
diff --git a/src/being/being.h b/src/being/being.h
index 0ca1ce780..775c875f9 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -679,6 +679,11 @@ class Being notfinal : public ActorSprite,
const int offsetY) const
restrict2 A_NONNULL(2);
+ void drawNpc(Graphics *restrict const graphics,
+ const int offsetX,
+ const int offsetY) const
+ restrict2 A_NONNULL(2);
+
void drawMonster(Graphics *restrict const graphics,
const int offsetX,
const int offsetY) const
@@ -1106,6 +1111,10 @@ class Being notfinal : public ActorSprite,
const int x,
const int y) const restrict2 A_NONNULL(2);
+ void drawNpcSpriteAt(Graphics *restrict const graphics,
+ const int x,
+ const int y) const restrict2 A_NONNULL(2);
+
void drawPortalSpriteAt(Graphics *restrict const graphics,
const int x,
const int y) const restrict2 A_NONNULL(2);
diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp
index a39c65122..7a91b413b 100644
--- a/src/net/eathena/beingrecv.cpp
+++ b/src/net/eathena/beingrecv.cpp
@@ -131,6 +131,17 @@ static void setBasicFields(Being *restrict const dstBeing,
{
dstBeing->setGender(Being::intToGender(gender));
}
+ dstBeing->setHairColor(hairColor);
+ dstBeing->setHairStyle(SPRITE_HAIR_COLOR, -hairStyle);
+ // for npc not checking updateSlots flag,
+ // probably because npc missing visible packet if moving
+ dstBeing->updateSprite(SPRITE_WEAPON, headBottom);
+ dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid);
+ dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop);
+ dstBeing->updateSprite(SPRITE_HAIR, shoes);
+ dstBeing->updateSprite(SPRITE_SHOES, gloves);
+ dstBeing->updateSprite(SPRITE_BODY, weapon);
+ dstBeing->setWeaponId(weapon);
break;
default:
case ActorType::Monster: