From 19cd2e0b78af5bebc10f37bde57f7c3a24ad04ac Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 6 May 2013 21:47:51 +0300 Subject: improve charcreatedialog. --- src/gui/charcreatedialog.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/gui') 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(mRace)); - const ItemInfo &item = ItemDB::get(id); + const ItemInfo &item = ItemDB::get(-100 - mRace); mRaceNameLabel->setCaption(item.getName()); mRaceNameLabel->adjustSize(); } -- cgit v1.2.3-70-g09d2