summaryrefslogtreecommitdiffstats
path: root/source/Pawn.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Pawn.cpp')
-rw-r--r--source/Pawn.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/Pawn.cpp b/source/Pawn.cpp
index c1b8d6683..960f95de3 100644
--- a/source/Pawn.cpp
+++ b/source/Pawn.cpp
@@ -315,8 +315,14 @@ void cPawn::SetMetaData(MetaData a_MetaData)
//----Change Entity MetaData
-void cPawn::CheckMetaDataBurn()
+void cPawn::CheckMetaDataBurn(void)
{
+ if ((GetPosY() < 1) || (GetPosY() >= 254))
+ {
+ // Y coord out of range
+ return;
+ }
+
BLOCKTYPE Block = GetWorld()->GetBlock((int) GetPosX(), (int) GetPosY(), (int) GetPosZ());
BLOCKTYPE BlockAbove = GetWorld()->GetBlock((int) GetPosX(), (int) GetPosY() + 1, (int) GetPosZ());
BLOCKTYPE BlockBelow = GetWorld()->GetBlock((int) GetPosX(), (int) GetPosY() - 1, (int) GetPosZ());