summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-06 21:47:51 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-06 21:47:51 +0300
commit19cd2e0b78af5bebc10f37bde57f7c3a24ad04ac (patch)
tree49d9e0f78b85daf9dc36ac654b0b6886f8d5c9f4
parent551e9f611c391e3df4e7635a624336586a39fdfc (diff)
downloadManaVerse-19cd2e0b78af5bebc10f37bde57f7c3a24ad04ac.tar.gz
ManaVerse-19cd2e0b78af5bebc10f37bde57f7c3a24ad04ac.tar.bz2
ManaVerse-19cd2e0b78af5bebc10f37bde57f7c3a24ad04ac.tar.xz
ManaVerse-19cd2e0b78af5bebc10f37bde57f7c3a24ad04ac.zip
improve charcreatedialog.
-rw-r--r--src/gui/charcreatedialog.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gui/charcreatedialog.cpp b/src/gui/charcreatedialog.cpp
index bbfd08939..7ccfeb6f1 100644
--- a/src/gui/charcreatedialog.cpp
+++ b/src/gui/charcreatedialog.cpp
@@ -272,8 +272,8 @@ CharCreateDialog::~CharCreateDialog()
delete mPlayer;
mPlayer = nullptr;
- // Make sure the char server handler knows that we're gone
- Net::getCharServerHandler()->setCharCreateDialog(nullptr);
+ if (Net::getCharServerHandler())
+ Net::getCharServerHandler()->setCharCreateDialog(nullptr);
}
void CharCreateDialog::action(const gcn::ActionEvent &event)
@@ -556,15 +556,13 @@ void CharCreateDialog::updateHair()
void CharCreateDialog::updateRace()
{
- int id;
if (mRace < 0)
mRace = Being::getNumOfRaces() - 1;
else if (mRace >= Being::getNumOfRaces())
mRace = 0;
- id = -100 - mRace;
mPlayer->setSubtype(static_cast<uint16_t>(mRace));
- const ItemInfo &item = ItemDB::get(id);
+ const ItemInfo &item = ItemDB::get(-100 - mRace);
mRaceNameLabel->setCaption(item.getName());
mRaceNameLabel->adjustSize();
}