11-15-2013, 06:15 AM
I'm trying to make other wolves attack players when a wolf is attacked by a player, but I need to convert an cEntity to an cMonster in order to use GetMobType(). This is the code I use:
class cCallback :
public cEntityCallback
{
virtual bool Item(cEntity * a_Entity) override
{
if (a_Entity->IsMob())
{
if (a_Entity->GetMobType() == cMonster::mtWolf)
{
double Distance = (a_Entity->GetPosition() - ThisWolfPos).Length();
if (Distance < 20)
{
}
}
}
return false;
}
public:
Vector3f ThisWolfPos = GetPosition();
} Callback; Callback;

