[8137] Init player display id + native display id on login. Author: hunuza

* Temporary reset of display id on save no longer needed.
    * Players always have the right model for their gender.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-07-10 08:39:14 +08:00
parent bf6102e7ed
commit d27e5f3de1
5 changed files with 42 additions and 58 deletions

View File

@@ -5362,9 +5362,6 @@ bool ChatHandler::HandleResetHonorCommand (const char * args)
static bool HandleResetStatsOrLevelHelper(Player* player)
{
PlayerInfo const *info = objmgr.GetPlayerInfo(player->getRace(), player->getClass());
if(!info) return false;
ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(player->getClass());
if(!cEntry)
{
@@ -5387,21 +5384,7 @@ static bool HandleResetStatsOrLevelHelper(Player* player)
// reset only if player not in some form;
if(player->m_form==FORM_NONE)
{
switch(player->getGender())
{
case GENDER_FEMALE:
player->SetDisplayId(info->displayId_f);
player->SetNativeDisplayId(info->displayId_f);
break;
case GENDER_MALE:
player->SetDisplayId(info->displayId_m);
player->SetNativeDisplayId(info->displayId_m);
break;
default:
break;
}
}
player->InitDisplayIds();
player->SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP );
player->SetByteValue(UNIT_FIELD_BYTES_2, 3, player->m_form);
@@ -7449,8 +7432,7 @@ bool ChatHandler::HandleModifyGenderCommand(const char *args)
player->SetByteValue(PLAYER_BYTES_3, 0, gender);
// Change display ID
player->SetDisplayId(gender ? info->displayId_f : info->displayId_m);
player->SetNativeDisplayId(gender ? info->displayId_f : info->displayId_m);
player->InitDisplayIds();
char const* gender_full = gender ? "female" : "male";