Fixed not getting XP from mobs.
This commit is contained in:
parent
39443c63ad
commit
483ef89503
@ -49,8 +49,8 @@ void cExpOrb::Tick(float a_Dt, cChunk & a_Chunk)
|
|||||||
double Distance(a_Distance.Length());
|
double Distance(a_Distance.Length());
|
||||||
if (Distance < 0.1f)
|
if (Distance < 0.1f)
|
||||||
{
|
{
|
||||||
|
LOGD("Player %s picked up an ExpOrb. His reward is %i", a_ClosestPlayer->GetName().c_str(), m_Reward);
|
||||||
a_ClosestPlayer->DeltaExperience(m_Reward);
|
a_ClosestPlayer->DeltaExperience(m_Reward);
|
||||||
a_ClosestPlayer->SendExperience();
|
|
||||||
Destroy(true);
|
Destroy(true);
|
||||||
}
|
}
|
||||||
a_Distance.Normalize();
|
a_Distance.Normalize();
|
||||||
|
@ -274,6 +274,7 @@ void cMonster::KilledBy(cEntity * a_Killer)
|
|||||||
case cMonster::mtWolf:
|
case cMonster::mtWolf:
|
||||||
{
|
{
|
||||||
Reward = m_World->GetTickRandomNumber(2) + 1;
|
Reward = m_World->GetTickRandomNumber(2) + 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Monsters
|
// Monsters
|
||||||
@ -291,25 +292,30 @@ void cMonster::KilledBy(cEntity * a_Killer)
|
|||||||
case cMonster::mtMagmaCube:
|
case cMonster::mtMagmaCube:
|
||||||
{
|
{
|
||||||
Reward = 6 + (m_World->GetTickRandomNumber(2));
|
Reward = 6 + (m_World->GetTickRandomNumber(2));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case cMonster::mtBlaze:
|
case cMonster::mtBlaze:
|
||||||
{
|
{
|
||||||
Reward = 10;
|
Reward = 10;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bosses
|
// Bosses
|
||||||
case cMonster::mtEnderDragon:
|
case cMonster::mtEnderDragon:
|
||||||
{
|
{
|
||||||
Reward = 12000;
|
Reward = 12000;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case cMonster::mtWither:
|
case cMonster::mtWither:
|
||||||
{
|
{
|
||||||
Reward = 50;
|
Reward = 50;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
Reward = 0;
|
Reward = 0;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_World->SpawnExperienceOrb(GetPosX(), GetPosY(), GetPosZ(), Reward);
|
m_World->SpawnExperienceOrb(GetPosX(), GetPosY(), GetPosZ(), Reward);
|
||||||
|
Loading…
Reference in New Issue
Block a user