[10823] Clear way access/set UNIT_FIELD_BYTES_*/PLAYER_BYTES* byte fields.

Fix some bugs when all uint32 field modified instead byte parts.
In some cases added byte way set/get but code line itself need additinal reserch/fix
for use correctness in line pos.
This commit is contained in:
VladimirMangos 2010-12-04 11:07:40 +03:00
parent 9e071e4483
commit b967848e42
5 changed files with 63 additions and 50 deletions

View file

@ -4725,7 +4725,7 @@ static bool HandleResetStatsOrLevelHelper(Player* player)
player->setFactionForRace(player->getRace());
player->SetUInt32Value(UNIT_FIELD_BYTES_0, ( ( player->getRace() ) | ( player->getClass() << 8 ) | ( player->getGender() << 16 ) | ( powertype << 24 ) ) );
player->SetByteValue(UNIT_FIELD_BYTES_0, 3, powertype);
// reset only if player not in some form;
if(player->m_form==FORM_NONE)
@ -6691,7 +6691,7 @@ bool ChatHandler::HandleModifyGenderCommand(char *args)
// Set gender
player->SetByteValue(UNIT_FIELD_BYTES_0, 2, gender);
player->SetByteValue(PLAYER_BYTES_3, 0, gender);
player->SetUInt16Value(PLAYER_BYTES_3, 0, uint16(gender) | (player->GetDrunkValue() & 0xFFFE));
// Change display ID
player->InitDisplayIds();