Cleanup code for UNIT_FIELD_BYTES_1 parts.

Move defines to Unit (values can be used with creatures)
Better gameobject barber chairs check at loading.
This commit is contained in:
VladimirMangos 2009-01-31 05:47:02 +03:00
parent af888cda40
commit a1b5c3cb02
10 changed files with 75 additions and 76 deletions

View file

@ -2371,7 +2371,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
// cleanup player flags (will be re-applied if need at aura load), to avoid have ghost flag without ghost aura, for example.
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK | PLAYER_FLAGS_DND | PLAYER_FLAGS_GM | PLAYER_FLAGS_GHOST);
SetByteValue(UNIT_FIELD_BYTES_1, 2, 0x00); // one form stealth modified bytes
RemoveStandFlags(UNIT_STAND_FLAGS_ALL); // one form stealth modified bytes
RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP | UNIT_BYTE2_FLAG_SANCTUARY);
// restore if need some important flags
@ -3814,7 +3814,8 @@ void Player::BuildPlayerRepop()
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, (float)1.0); //see radius of death player?
SetByteValue(UNIT_FIELD_BYTES_1, 3, PLAYER_STATE_FLAG_ALWAYS_STAND);
// set and clear other
SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND);
}
void Player::SendDelayResponse(const uint32 ml_seconds)
@ -15479,9 +15480,9 @@ void Player::SaveToDB()
uint32 tmp_displayid = GetDisplayId();
// Set player sit state to standing on save, also stealth and shifted form
SetByteValue(UNIT_FIELD_BYTES_1, 0, 0); // stand state
SetStandState(UNIT_STAND_STATE_STAND); // stand state
RemoveStandFlags(UNIT_STAND_FLAGS_ALL); // stand flags?
SetByteValue(UNIT_FIELD_BYTES_2, 3, 0); // shapeshift
SetByteValue(UNIT_FIELD_BYTES_1, 3, 0); // stand flags?
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
SetDisplayId(GetNativeDisplayId());