From f9a06a168a4c4354dcffdba7243b4eff783adb5b Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Thu, 12 Mar 2009 09:03:24 -0600 Subject: 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 --- src/being.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/being.cpp') 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; +} + -- cgit v1.2.3-70-g09d2