diff options
author | Ira Rice <irarice@gmail.com> | 2009-03-12 09:03:24 -0600 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-03-12 09:03:24 -0600 |
commit | f9a06a168a4c4354dcffdba7243b4eff783adb5b (patch) | |
tree | 900523bb32b72446d8408966cf8f98758463e8d5 /src | |
parent | 37b812f2892a9b11a88abcbcde0b47aca76f4a71 (diff) | |
download | mana-f9a06a168a4c4354dcffdba7243b4eff783adb5b.tar.gz mana-f9a06a168a4c4354dcffdba7243b4eff783adb5b.tar.bz2 mana-f9a06a168a4c4354dcffdba7243b4eff783adb5b.tar.xz mana-f9a06a168a4c4354dcffdba7243b4eff783adb5b.zip |
Made hair load again (commit e2d60401eaf55abe9e2251854f3174ffe0f4ad9e
from TMW broke this, as it deleted the Being::load() method, which also
loaded the hair styles). Also removed some unused variables in the being
class.
Signed-off-by: Ira Rice <irarice@gmail.com>
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; |