1
0

- Animals burn now when moving into lava or fire

- Monster health is now working properly

git-svn-id: http://mc-server.googlecode.com/svn/trunk@157 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
lapayo94@gmail.com 2011-12-29 22:55:25 +00:00
parent d7adbba59d
commit 9d3b2d1335
3 changed files with 12 additions and 7 deletions

View File

@ -87,7 +87,7 @@ void cMonsterConfig::AssignAttributes(cMonster *m, const char* n)
m->SetAttackRange(itr->m_AttackRange);
m->SetSightDistance(itr->m_SightDistance);
m->SetAttackRate((int)itr->m_AttackRate);
m->SetMaxHealth((int)itr->m_AttackRate);
m->SetMaxHealth((int)itr->m_MaxHealth);
}
}
}

View File

@ -26,6 +26,7 @@ cPawn::cPawn()
, m_bBurnable(true)
, m_MetaData(NORMAL)
, m_FireDamageInterval(0.f)
, m_BurnPeriod(0.f)
{
SetMaxHealth(20);
SetMaxFoodLevel(125);
@ -125,16 +126,19 @@ void cPawn::SetMetaData(MetaData a_MetaData)
void cPawn::CheckMetaDataBurn()
{
char Block = GetWorld()->GetBlock((int) m_Pos->x, (int) m_Pos->y, (int) m_Pos->z);
char BlockAbove = GetWorld()->GetBlock((int) m_Pos->x, (int) m_Pos->y + 1, (int) m_Pos->z);
char BlockBelow = GetWorld()->GetBlock((int) m_Pos->x, (int) m_Pos->y - 1, (int) m_Pos->z);
if(GetMetaData() == BURNING
&& (IsBlockWater(Block)
|| IsBlockWater(BlockAbove)))
|| IsBlockWater(BlockAbove)
|| IsBlockWater(BlockBelow)))
{
SetMetaData(NORMAL);
}else if(m_bBurnable && GetMetaData() != BURNING
&& (IsBlockLava(Block) || Block == E_BLOCK_FIRE
|| IsBlockLava(BlockAbove) || BlockAbove == E_BLOCK_FIRE)) {
|| IsBlockLava(BlockAbove) || BlockAbove == E_BLOCK_FIRE
|| IsBlockLava(BlockBelow) || BlockBelow == E_BLOCK_FIRE)) {
SetMetaData(BURNING);
}
}

View File

@ -72,7 +72,8 @@ bool cSandSimulator::IsPassable( char a_BlockID )
{
return a_BlockID == E_BLOCK_AIR
|| IsBlockWater(a_BlockID)
|| IsBlockLava(a_BlockID);
|| IsBlockLava(a_BlockID)
|| a_BlockID == E_BLOCK_FIRE;
}