[12037] Use enum for rest state

This commit is contained in:
stfx 2012-07-07 13:18:56 +02:00 committed by Schmoozerd
parent 6e8111261c
commit d563c6576d
3 changed files with 13 additions and 6 deletions

View file

@ -672,7 +672,7 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
SetByteValue(PLAYER_BYTES, 3, hairColor);
SetByteValue(PLAYER_BYTES_2, 0, facialHair);
SetByteValue(PLAYER_BYTES_2, 3, 0x02); // rest state = normal
SetByteValue(PLAYER_BYTES_2, 3, REST_STATE_NORMAL);
SetUInt16Value(PLAYER_BYTES_3, 0, gender); // only GENDER_MALE/GENDER_FEMALE (1 bit) allowed, drunk state = 0
SetByteValue(PLAYER_BYTES_3, 3, 0); // BattlefieldArenaFaction (0 or 1)
@ -18835,9 +18835,9 @@ void Player::SetRestBonus (float rest_bonus_new)
// update data for client
if (m_rest_bonus > 10)
SetByteValue(PLAYER_BYTES_2, 3, 0x01); // Set Reststate = Rested
SetByteValue(PLAYER_BYTES_2, 3, REST_STATE_RESTED);
else if (m_rest_bonus <= 1)
SetByteValue(PLAYER_BYTES_2, 3, 0x02); // Set Reststate = Normal
SetByteValue(PLAYER_BYTES_2, 3, REST_STATE_NORMAL);
//RestTickUpdate
SetUInt32Value(PLAYER_REST_STATE_EXPERIENCE, uint32(m_rest_bonus));

View file

@ -870,6 +870,13 @@ struct InstancePlayerBind
InstancePlayerBind() : state(NULL), perm(false) {}
};
enum PlayerRestState
{
REST_STATE_RESTED = 0x01,
REST_STATE_NORMAL = 0x02,
REST_STATE_RAF_LINKED = 0x04 // Exact use unknown
};
class MANGOS_DLL_SPEC PlayerTaxi
{
public:

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12036"
#define REVISION_NR "12037"
#endif // __REVISION_NR_H__