Fixed segmentation fault on villager damage

It occurred when attack was environmental.
master
Tiger Wang 2014-01-26 00:14:00 +00:00
parent f78a62a5e3
commit 70113b5730
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ cVillager::cVillager(eVillagerType VillagerType) :
void cVillager::DoTakeDamage(TakeDamageInfo & a_TDI)
{
super::DoTakeDamage(a_TDI);
if (a_TDI.Attacker->IsPlayer())
if ((a_TDI.Attacker != NULL) && a_TDI.Attacker->IsPlayer())
{
if (m_World->GetTickRandomNumber(5) == 3)
{