mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[12037] Use enum for rest state
This commit is contained in:
parent
6e8111261c
commit
d563c6576d
3 changed files with 13 additions and 6 deletions
|
|
@ -672,7 +672,7 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
|
||||||
SetByteValue(PLAYER_BYTES, 3, hairColor);
|
SetByteValue(PLAYER_BYTES, 3, hairColor);
|
||||||
|
|
||||||
SetByteValue(PLAYER_BYTES_2, 0, facialHair);
|
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
|
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)
|
SetByteValue(PLAYER_BYTES_3, 3, 0); // BattlefieldArenaFaction (0 or 1)
|
||||||
|
|
@ -18834,10 +18834,10 @@ void Player::SetRestBonus (float rest_bonus_new)
|
||||||
m_rest_bonus = rest_bonus_new;
|
m_rest_bonus = rest_bonus_new;
|
||||||
|
|
||||||
// update data for client
|
// update data for client
|
||||||
if(m_rest_bonus>10)
|
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)
|
else if (m_rest_bonus <= 1)
|
||||||
SetByteValue(PLAYER_BYTES_2, 3, 0x02); // Set Reststate = Normal
|
SetByteValue(PLAYER_BYTES_2, 3, REST_STATE_NORMAL);
|
||||||
|
|
||||||
//RestTickUpdate
|
//RestTickUpdate
|
||||||
SetUInt32Value(PLAYER_REST_STATE_EXPERIENCE, uint32(m_rest_bonus));
|
SetUInt32Value(PLAYER_REST_STATE_EXPERIENCE, uint32(m_rest_bonus));
|
||||||
|
|
|
||||||
|
|
@ -870,6 +870,13 @@ struct InstancePlayerBind
|
||||||
InstancePlayerBind() : state(NULL), perm(false) {}
|
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
|
class MANGOS_DLL_SPEC PlayerTaxi
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "12036"
|
#define REVISION_NR "12037"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue