summaryrefslogtreecommitdiffstats
path: root/source/Blocks
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/Blocks/BlockDirt.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/Blocks/BlockDirt.h b/source/Blocks/BlockDirt.h
index 31d981cb2..9617a47da 100644
--- a/source/Blocks/BlockDirt.h
+++ b/source/Blocks/BlockDirt.h
@@ -51,15 +51,16 @@ public:
BLOCKTYPE DestBlock;
NIBBLETYPE DestMeta;
- a_World->GetBlockTypeMeta(a_BlockX + OfsX, a_BlockY + OfsY, a_BlockZ + OfsZ, DestBlock, DestMeta);
- if(DestBlock != E_BLOCK_DIRT)
+ bool IsValid = a_World->GetBlockTypeMeta(a_BlockX + OfsX, a_BlockY + OfsY, a_BlockZ + OfsZ, DestBlock, DestMeta);
+ if (!IsValid || (DestBlock != E_BLOCK_DIRT))
{
continue;
}
BLOCKTYPE AboveDest;
NIBBLETYPE AboveMeta;
- a_World->GetBlockTypeMeta(a_BlockX + OfsX, a_BlockY + OfsY + 1, a_BlockZ + OfsZ, AboveDest, AboveMeta);
+ IsValid = a_World->GetBlockTypeMeta(a_BlockX + OfsX, a_BlockY + OfsY + 1, a_BlockZ + OfsZ, AboveDest, AboveMeta);
+ ASSERT(IsValid); // WTF - how did we get the DestBlock if AboveBlock is not valid?
if (g_BlockOneHitDig[AboveDest] || g_BlockTransparent[AboveDest])
{
a_World->FastSetBlock(a_BlockX + OfsX, a_BlockY + OfsY, a_BlockZ + OfsZ, E_BLOCK_GRASS, 0);