From a49c004278b0e300521e9cedf44a46ac843a958b Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 13 Apr 2013 21:02:10 +0000 Subject: Rewritten entities so that they are owned by individual chunks and ticked within their chunk's Tick() git-svn-id: http://mc-server.googlecode.com/svn/trunk@1385 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Pawn.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source/Pawn.cpp') diff --git a/source/Pawn.cpp b/source/Pawn.cpp index 960f95de3..b3cba7ab0 100644 --- a/source/Pawn.cpp +++ b/source/Pawn.cpp @@ -288,11 +288,11 @@ void cPawn::TeleportTo(double a_PosX, double a_PosY, double a_PosZ) -void cPawn::Tick(float a_Dt, MTRand & a_TickRandom) +void cPawn::Tick(float a_Dt, cChunk & a_Chunk) { - CheckMetaDataBurn(); // Check to see if pawn should burn based on block they are on + CheckMetaDataBurn(a_Chunk); // Check to see if pawn should burn based on block they are on - if (GetMetaData() == BURNING) + if (IsBurning()) { InStateBurning(a_Dt); } @@ -315,8 +315,10 @@ void cPawn::SetMetaData(MetaData a_MetaData) //----Change Entity MetaData -void cPawn::CheckMetaDataBurn(void) +void cPawn::CheckMetaDataBurn(cChunk & a_Chunk) { + // TODO: Rewrite this function to use a_Chunk instead of m_World + if ((GetPosY() < 1) || (GetPosY() >= 254)) { // Y coord out of range -- cgit v1.2.3