diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/being.cpp | 16 | ||||
-rw-r--r-- | src/being.h | 4 | ||||
-rw-r--r-- | src/main.cpp | 1 |
3 files changed, 17 insertions, 4 deletions
diff --git a/src/being.cpp b/src/being.cpp index 54908b07..64972912 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -83,8 +83,7 @@ Being::Being(int id, int job, Map *map): mSprites(VECTOREND_SPRITE, NULL), mSpriteIDs(VECTOREND_SPRITE, 0), mSpriteColors(VECTOREND_SPRITE, ""), - mStatusParticleEffects(&mStunParticleEffects, false), - mChildParticleEffects(&mStatusParticleEffects, false), + mChildParticleEffects(), mUsedTargetCursor(NULL) { setMap(map); @@ -578,3 +577,16 @@ void Being::setTargetAnimation(SimpleAnimation* animation) mUsedTargetCursor->reset(); } +void Being::load() +{ + // Hairstyles are encoded as negative numbers. Count how far negative + // we can go. + int hairstyles = 1; + + while (ItemDB::get(-hairstyles).getSprite(GENDER_MALE) != "error.xml") + { + hairstyles++; + } + mNumberOfHairstyles = hairstyles; +} + diff --git a/src/being.h b/src/being.h index 6f3125c8..d7a7d1d5 100644 --- a/src/being.h +++ b/src/being.h @@ -402,6 +402,8 @@ class Being : public Sprite virtual AnimatedSprite* getSprite(int index) const { return mSprites[index]; } + static void load(); + protected: /** * Sets the new path for this being. @@ -450,8 +452,6 @@ class Being : public Sprite std::vector<AnimatedSprite*> mSprites; std::vector<int> mSpriteIDs; std::vector<std::string> mSpriteColors; - ParticleList mStunParticleEffects; - ParticleVector mStatusParticleEffects; ParticleList mChildParticleEffects; private: diff --git a/src/main.cpp b/src/main.cpp index a7032fb1..fab7ed95 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -939,6 +939,7 @@ int main(int argc, char *argv[]) MonsterDB::load(); NPCDB::load(); EmoteDB::load(); + Being::load(); // Hairstyles state = CHAR_CONNECT_STATE; break; |