Add entity invulnerable
This commit is contained in:
@@ -23,9 +23,13 @@ cVillager::cVillager(eVillagerType VillagerType) :
|
||||
|
||||
|
||||
|
||||
void cVillager::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
bool cVillager::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
super::DoTakeDamage(a_TDI);
|
||||
if (!super::DoTakeDamage(a_TDI))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((a_TDI.Attacker != NULL) && a_TDI.Attacker->IsPlayer())
|
||||
{
|
||||
if (m_World->GetTickRandomNumber(5) == 3)
|
||||
@@ -33,6 +37,7 @@ void cVillager::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
m_World->BroadcastEntityStatus(*this, esVillagerAngry);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user