1
0
This commit is contained in:
Tiger Wang 2014-04-18 12:54:17 +01:00
parent 193dcca1e3
commit 200ea6254c
2 changed files with 6 additions and 1 deletions

View File

@ -540,7 +540,7 @@ void cMonster::KilledBy(cEntity * a_Killer)
break; break;
} }
} }
if (a_Killer != NULL) if ((a_Killer != NULL) && (!IsBaby())
{ {
m_World->SpawnExperienceOrb(GetPosX(), GetPosY(), GetPosZ(), Reward); m_World->SpawnExperienceOrb(GetPosX(), GetPosY(), GetPosZ(), Reward);
} }

View File

@ -1691,6 +1691,11 @@ int cWorld::SpawnFallingBlock(int a_X, int a_Y, int a_Z, BLOCKTYPE BlockType, NI
int cWorld::SpawnExperienceOrb(double a_X, double a_Y, double a_Z, int a_Reward) int cWorld::SpawnExperienceOrb(double a_X, double a_Y, double a_Z, int a_Reward)
{ {
if (a_Reward < 1)
{
return -1;
}
cExpOrb * ExpOrb = new cExpOrb(a_X, a_Y, a_Z, a_Reward); cExpOrb * ExpOrb = new cExpOrb(a_X, a_Y, a_Z, a_Reward);
ExpOrb->Initialize(this); ExpOrb->Initialize(this);
return ExpOrb->GetUniqueID(); return ExpOrb->GetUniqueID();