summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/Bindings.cpp5
-rw-r--r--source/Entities/Entity.h21
-rw-r--r--source/Mobs/Monster.cpp2
-rw-r--r--source/Mobs/Villager.h13
-rw-r--r--source/Protocol/Protocol125.cpp5
-rw-r--r--source/World.cpp2
6 files changed, 19 insertions, 29 deletions
diff --git a/source/Bindings.cpp b/source/Bindings.cpp
index a08985144..ae2082511 100644
--- a/source/Bindings.cpp
+++ b/source/Bindings.cpp
@@ -29494,11 +29494,6 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
tolua_constant(tolua_S,"etBoat",cEntity::etBoat);
tolua_constant(tolua_S,"etTNT",cEntity::etTNT);
tolua_constant(tolua_S,"etProjectile",cEntity::etProjectile);
- tolua_constant(tolua_S,"etMob",cEntity::etMob);
- tolua_constant(tolua_S,"eEntityType_Entity",cEntity::eEntityType_Entity);
- tolua_constant(tolua_S,"eEntityType_Player",cEntity::eEntityType_Player);
- tolua_constant(tolua_S,"eEntityType_Pickup",cEntity::eEntityType_Pickup);
- tolua_constant(tolua_S,"eEntityType_Mob",cEntity::eEntityType_Mob);
tolua_function(tolua_S,"GetEntityType",tolua_AllToLua_cEntity_GetEntityType00);
tolua_function(tolua_S,"IsPlayer",tolua_AllToLua_cEntity_IsPlayer00);
tolua_function(tolua_S,"IsPickup",tolua_AllToLua_cEntity_IsPickup00);
diff --git a/source/Entities/Entity.h b/source/Entities/Entity.h
index 07bc84937..064275c06 100644
--- a/source/Entities/Entity.h
+++ b/source/Entities/Entity.h
@@ -102,13 +102,6 @@ public:
etBoat,
etTNT,
etProjectile,
-
- // DEPRECATED older constants, left over for compatibility reasons (plugins)
- etMob = etMonster, // DEPRECATED, use etMonster instead!
- eEntityType_Entity = etEntity,
- eEntityType_Player = etPlayer,
- eEntityType_Pickup = etPickup,
- eEntityType_Mob = etMob,
} ;
// tolua_end
@@ -123,12 +116,14 @@ public:
eEntityType GetEntityType(void) const { return m_EntityType; }
- bool IsPlayer (void) const { return (m_EntityType == etPlayer); }
- bool IsPickup (void) const { return (m_EntityType == etPickup); }
- bool IsMob (void) const { return (m_EntityType == etMob); }
- bool IsMinecart(void) const { return (m_EntityType == etMinecart); }
- bool IsBoat (void) const { return (m_EntityType == etBoat); }
- bool IsTNT (void) const { return (m_EntityType == etTNT); }
+ bool IsPlayer (void) const { return (m_EntityType == etPlayer); }
+ bool IsPickup (void) const { return (m_EntityType == etPickup); }
+ bool IsMob (void) const { return (m_EntityType == etMonster); }
+ bool IsFallingBlock(void) const { return (m_EntityType == etFallingBlock); }
+ bool IsMinecart (void) const { return (m_EntityType == etMinecart); }
+ bool IsBoat (void) const { return (m_EntityType == etBoat); }
+ bool IsTNT (void) const { return (m_EntityType == etTNT); }
+ bool IsProjectile (void) const { return (m_EntityType == etProjectile); }
/// Returns true if the entity is of the specified class or a subclass (cPawn's IsA("cEntity") returns true)
virtual bool IsA(const char * a_ClassName) const;
diff --git a/source/Mobs/Monster.cpp b/source/Mobs/Monster.cpp
index 76b9414f7..334229a42 100644
--- a/source/Mobs/Monster.cpp
+++ b/source/Mobs/Monster.cpp
@@ -24,7 +24,7 @@
cMonster::cMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height)
- : super(etMob, a_Width, a_Height)
+ : super(etMonster, a_Width, a_Height)
, m_Target(NULL)
, m_AttackRate(3)
, idle_interval(0)
diff --git a/source/Mobs/Villager.h b/source/Mobs/Villager.h
index 86888d9eb..4cd9aaa8e 100644
--- a/source/Mobs/Villager.h
+++ b/source/Mobs/Villager.h
@@ -16,12 +16,13 @@ public:
enum eVillagerType
{
- VILLAGER_TYPE_FARMER = 0,
- VILLAGER_TYPE_LIBRARIAN = 1,
- VILLAGER_TYPE_PRIEST = 2,
- VILLAGER_TYPE_BLACKSMITH = 3,
- VILLAGER_TYPE_BUTCHER = 4,
- VILLAGER_TYPE_GENERIC = 5
+ vtFarmer = 0,
+ vtLibrarian = 1,
+ vtPriest = 2,
+ vtBlacksmith = 3,
+ vtButcher = 4,
+ vtGeneric = 5,
+ vtMax
} ;
cVillager(eVillagerType VillagerType);
diff --git a/source/Protocol/Protocol125.cpp b/source/Protocol/Protocol125.cpp
index 4730c3dfc..62863cd48 100644
--- a/source/Protocol/Protocol125.cpp
+++ b/source/Protocol/Protocol125.cpp
@@ -1695,18 +1695,17 @@ void cProtocol125::WriteEntityMetadata(const cEntity & a_Entity)
WriteByte(0x73);
WriteFloat((float)(((const cMinecart &)a_Entity).LastDamage() + 10)); // Damage taken / shake effect multiplyer
- if (a_Entity.IsA("cMinecartWithFurnace"))
+ if (((cMinecart &)a_Entity).GetPayload() == cMinecart::mpFurnace)
{
WriteByte(0x10);
WriteByte(((const cMinecartWithFurnace &)a_Entity).IsFueled() ? 1 : 0); // Fueled?
}
}
- else if (a_Entity.IsA("cArrowEntity"));
+ else if ((a_Entity.IsProjectile() && ((cProjectileEntity &)a_Entity).GetProjectileKind() == cProjectileEntity::pkArrow));
{
WriteByte(0x10);
WriteByte(((const cArrowEntity &)a_Entity).IsCritical() ? 1 : 0); // Critical hitting arrow?
}
-
}
diff --git a/source/World.cpp b/source/World.cpp
index da9466bf8..92098bd8b 100644
--- a/source/World.cpp
+++ b/source/World.cpp
@@ -2576,7 +2576,7 @@ int cWorld::SpawnMob(double a_PosX, double a_PosY, double a_PosZ, cMonster::eTyp
int ShColor = GetTickRandomNumber(15); // 0 .. 15 - Sheep
bool SkType = GetDimension() == biNether; // Skeleton
- int VilType = GetTickRandomNumber(6); // 0 .. 5 - Villager
+ int VilType = GetTickRandomNumber(cVillager::vtMax); // 0 .. 6 - Villager
if (VilType == 6) { VilType = 0; } // Give farmers a better chance of spawning
int HseType = GetTickRandomNumber(7); // 0 .. 7 - Horse Type (donkey, zombie, etc.)