diff options
author | Ira Rice <irarice@gmail.com> | 2008-10-19 23:07:35 +0000 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2008-10-19 23:07:35 +0000 |
commit | e57f4ec64f53091dd254c2ee2db9592d30a5af0b (patch) | |
tree | ef002e7fb4b0dfb5b06dd4e4c2d95b9f3b06f920 | |
parent | be1af40e371845bcad1337cc59e5f5ac0f991f02 (diff) | |
download | mana-e57f4ec64f53091dd254c2ee2db9592d30a5af0b.tar.gz mana-e57f4ec64f53091dd254c2ee2db9592d30a5af0b.tar.bz2 mana-e57f4ec64f53091dd254c2ee2db9592d30a5af0b.tar.xz mana-e57f4ec64f53091dd254c2ee2db9592d30a5af0b.zip |
Fixed a small error that I didn't notice before with de-hardcoding the
colors. Thanks goes to paks for noticing this.
-rw-r--r-- | src/being.cpp | 3 | ||||
-rw-r--r-- | src/gui/char_select.cpp | 3 | ||||
-rw-r--r-- | src/player.cpp | 1 | ||||
-rw-r--r-- | src/resources/colordb.cpp | 2 | ||||
-rw-r--r-- | src/resources/colordb.h | 2 |
5 files changed, 6 insertions, 5 deletions
diff --git a/src/being.cpp b/src/being.cpp index f05652f3..07c0716d 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -478,10 +478,7 @@ void Being::drawSpeech(Graphics *graphics, int offsetX, int offsetY) mSpeechBubble->setVisible(false); // don't introduce a memory leak if (mText) - { delete mText; - mText = 0; - } mText = new Text(mSpeech, mPx + X_SPEECH_OFFSET, mPy - Y_SPEECH_OFFSET, gcn::Graphics::CENTER, speechFont, diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index 65d0159f..628ab35f 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -257,8 +257,11 @@ CharCreateDialog::CharCreateDialog(Window *parent, int slot, Network *network, mPlayer = new Player(0, 0, NULL); mPlayer->setGender(gender); + ColorDB::load(); int numberOfHairColors = ColorDB::size(); + printf("%d\n", numberOfHairColors); + mPlayer->setHairStyle(rand() % NR_HAIR_STYLES, rand() % numberOfHairColors); mNameField = new TextField(""); diff --git a/src/player.cpp b/src/player.cpp index 37badcdc..4025f8f4 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -44,6 +44,7 @@ Player::Player(int id, int job, Map *map): { mName = 0; mIsGM = false; + ColorDB::load(); } Player::~Player() diff --git a/src/resources/colordb.cpp b/src/resources/colordb.cpp index 837561ed..f738b471 100644 --- a/src/resources/colordb.cpp +++ b/src/resources/colordb.cpp @@ -113,7 +113,7 @@ std::string& ColorDB::get(int id) } } -const int& ColorDB::size() +int ColorDB::size() { return mColors.size(); } diff --git a/src/resources/colordb.h b/src/resources/colordb.h index 43398af4..1f8b191c 100644 --- a/src/resources/colordb.h +++ b/src/resources/colordb.h @@ -42,7 +42,7 @@ namespace ColorDB std::string& get(int id); - const int& size(); + int size(); // Color DB typedef std::map<int, std::string> Colors; |