summaryrefslogtreecommitdiffstats
path: root/source/cPawn.cpp
diff options
context:
space:
mode:
authorlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-29 23:55:25 +0100
committerlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-29 23:55:25 +0100
commit9d3b2d13351baf565ff0ee63767c1eaf6f66e04f (patch)
tree3e0d0bcf78f5b9414e05ef361cd6c68f3e921993 /source/cPawn.cpp
parent - Initial food handling by cedeel (diff)
downloadcuberite-9d3b2d13351baf565ff0ee63767c1eaf6f66e04f.tar
cuberite-9d3b2d13351baf565ff0ee63767c1eaf6f66e04f.tar.gz
cuberite-9d3b2d13351baf565ff0ee63767c1eaf6f66e04f.tar.bz2
cuberite-9d3b2d13351baf565ff0ee63767c1eaf6f66e04f.tar.lz
cuberite-9d3b2d13351baf565ff0ee63767c1eaf6f66e04f.tar.xz
cuberite-9d3b2d13351baf565ff0ee63767c1eaf6f66e04f.tar.zst
cuberite-9d3b2d13351baf565ff0ee63767c1eaf6f66e04f.zip
Diffstat (limited to '')
-rw-r--r--source/cPawn.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/cPawn.cpp b/source/cPawn.cpp
index 8b1c951bb..db61f734e 100644
--- a/source/cPawn.cpp
+++ b/source/cPawn.cpp
@@ -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,17 +126,20 @@ 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
+ }else if(m_bBurnable && GetMetaData() != BURNING
&& (IsBlockLava(Block) || Block == E_BLOCK_FIRE
- || IsBlockLava(BlockAbove) || BlockAbove == E_BLOCK_FIRE)) {
- SetMetaData(BURNING);
+ || IsBlockLava(BlockAbove) || BlockAbove == E_BLOCK_FIRE
+ || IsBlockLava(BlockBelow) || BlockBelow == E_BLOCK_FIRE)) {
+ SetMetaData(BURNING);
}
}