Merge pull request #1312 from mc-server/unnamed-enum
Various unnamed enum fixes
This commit is contained in:
commit
06cc5c22ef
@ -43,7 +43,7 @@ public:
|
|||||||
/** Individual enchantment IDs, corresponding to their NBT IDs: http://www.minecraftwiki.net/wiki/Data_Values#Enchantment_IDs
|
/** Individual enchantment IDs, corresponding to their NBT IDs: http://www.minecraftwiki.net/wiki/Data_Values#Enchantment_IDs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
enum
|
enum eEnchantment
|
||||||
{
|
{
|
||||||
enchProtection = 0,
|
enchProtection = 0,
|
||||||
enchFireProtection = 1,
|
enchFireProtection = 1,
|
||||||
|
@ -33,6 +33,15 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const int cPlayer::MAX_HEALTH = 20;
|
||||||
|
|
||||||
|
const int cPlayer::MAX_FOOD_LEVEL = 20;
|
||||||
|
|
||||||
|
/** Number of ticks it takes to eat an item */
|
||||||
|
const int cPlayer::EATING_TICKS = 30;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName) :
|
cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName) :
|
||||||
@ -509,7 +518,7 @@ void cPlayer::Heal(int a_Health)
|
|||||||
|
|
||||||
void cPlayer::SetFoodLevel(int a_FoodLevel)
|
void cPlayer::SetFoodLevel(int a_FoodLevel)
|
||||||
{
|
{
|
||||||
int FoodLevel = std::max(0, std::min(a_FoodLevel, (int)MAX_FOOD_LEVEL));
|
int FoodLevel = Clamp(a_FoodLevel, 0, MAX_FOOD_LEVEL);
|
||||||
|
|
||||||
if (cRoot::Get()->GetPluginManager()->CallHookPlayerFoodLevelChange(*this, FoodLevel))
|
if (cRoot::Get()->GetPluginManager()->CallHookPlayerFoodLevelChange(*this, FoodLevel))
|
||||||
{
|
{
|
||||||
|
@ -29,12 +29,13 @@ class cPlayer :
|
|||||||
typedef cPawn super;
|
typedef cPawn super;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum
|
static const int MAX_HEALTH;
|
||||||
{
|
|
||||||
MAX_HEALTH = 20,
|
static const int MAX_FOOD_LEVEL;
|
||||||
MAX_FOOD_LEVEL = 20,
|
|
||||||
EATING_TICKS = 30, ///< Number of ticks it takes to eat an item
|
/** Number of ticks it takes to eat an item */
|
||||||
} ;
|
static const int EATING_TICKS;
|
||||||
|
|
||||||
// tolua_end
|
// tolua_end
|
||||||
|
|
||||||
CLASS_PROTODEF(cPlayer)
|
CLASS_PROTODEF(cPlayer)
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
class cHTTPMessage
|
class cHTTPMessage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum
|
enum eStatus
|
||||||
{
|
{
|
||||||
HTTP_OK = 200,
|
HTTP_OK = 200,
|
||||||
HTTP_BAD_REQUEST = 400,
|
HTTP_BAD_REQUEST = 400,
|
||||||
|
@ -39,8 +39,8 @@ public:
|
|||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
invArmorCount = 4,
|
invArmorCount = 4,
|
||||||
invInventoryCount = 9 * 3,
|
invInventoryCount = 9 * 3,
|
||||||
invHotbarCount = 9,
|
invHotbarCount = 9,
|
||||||
|
|
||||||
invArmorOffset = 0,
|
invArmorOffset = 0,
|
||||||
invInventoryOffset = invArmorOffset + invArmorCount,
|
invInventoryOffset = invArmorOffset + invArmorCount,
|
||||||
|
@ -103,7 +103,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Results of packet-parsing:
|
/// Results of packet-parsing:
|
||||||
enum
|
enum eParseResult
|
||||||
{
|
{
|
||||||
PARSE_OK = 1,
|
PARSE_OK = 1,
|
||||||
PARSE_ERROR = -1,
|
PARSE_ERROR = -1,
|
||||||
|
Loading…
Reference in New Issue
Block a user