summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Enchantments.h2
-rw-r--r--src/Entities/Player.cpp11
-rw-r--r--src/Entities/Player.h13
-rw-r--r--src/HTTPServer/HTTPMessage.h2
-rw-r--r--src/Inventory.h4
-rw-r--r--src/Protocol/Protocol125.h2
6 files changed, 22 insertions, 12 deletions
diff --git a/src/Enchantments.h b/src/Enchantments.h
index 98d7c0d36..824f6aa55 100644
--- a/src/Enchantments.h
+++ b/src/Enchantments.h
@@ -43,7 +43,7 @@ public:
/** Individual enchantment IDs, corresponding to their NBT IDs: http://www.minecraftwiki.net/wiki/Data_Values#Enchantment_IDs
*/
- enum
+ enum eEnchantment
{
enchProtection = 0,
enchFireProtection = 1,
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 608316e9a..4398a5bf3 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -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) :
@@ -509,7 +518,7 @@ void cPlayer::Heal(int a_Health)
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))
{
diff --git a/src/Entities/Player.h b/src/Entities/Player.h
index e26808bfc..d3ed1ef9d 100644
--- a/src/Entities/Player.h
+++ b/src/Entities/Player.h
@@ -29,12 +29,13 @@ class cPlayer :
typedef cPawn super;
public:
- enum
- {
- MAX_HEALTH = 20,
- MAX_FOOD_LEVEL = 20,
- EATING_TICKS = 30, ///< Number of ticks it takes to eat an item
- } ;
+ static const int MAX_HEALTH;
+
+ static const int MAX_FOOD_LEVEL;
+
+ /** Number of ticks it takes to eat an item */
+ static const int EATING_TICKS;
+
// tolua_end
CLASS_PROTODEF(cPlayer)
diff --git a/src/HTTPServer/HTTPMessage.h b/src/HTTPServer/HTTPMessage.h
index e402c8ad6..c0667030f 100644
--- a/src/HTTPServer/HTTPMessage.h
+++ b/src/HTTPServer/HTTPMessage.h
@@ -18,7 +18,7 @@
class cHTTPMessage
{
public:
- enum
+ enum eStatus
{
HTTP_OK = 200,
HTTP_BAD_REQUEST = 400,
diff --git a/src/Inventory.h b/src/Inventory.h
index ed134aee4..5628fb0da 100644
--- a/src/Inventory.h
+++ b/src/Inventory.h
@@ -39,8 +39,8 @@ public:
enum
{
invArmorCount = 4,
- invInventoryCount = 9 * 3,
- invHotbarCount = 9,
+ invInventoryCount = 9 * 3,
+ invHotbarCount = 9,
invArmorOffset = 0,
invInventoryOffset = invArmorOffset + invArmorCount,
diff --git a/src/Protocol/Protocol125.h b/src/Protocol/Protocol125.h
index 18efeb079..3adac3055 100644
--- a/src/Protocol/Protocol125.h
+++ b/src/Protocol/Protocol125.h
@@ -103,7 +103,7 @@ public:
protected:
/// Results of packet-parsing:
- enum
+ enum eParseResult
{
PARSE_OK = 1,
PARSE_ERROR = -1,