From e26dc5cc0aaeb81ee7c6419ea91f8eef7d072ef3 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 1 Feb 2014 21:40:50 +0000 Subject: Added checks for ice into IsBlockWater() * This fixes players spawning in vast oceans of ice, as opposed to the previous water --- src/Defines.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/Defines.h') diff --git a/src/Defines.h b/src/Defines.h index 3a26f4be6..b3dbcc93e 100644 --- a/src/Defines.h +++ b/src/Defines.h @@ -254,9 +254,16 @@ inline bool IsValidItem(int a_ItemType) -inline bool IsBlockWater(BLOCKTYPE a_BlockType) +inline bool IsBlockWater(BLOCKTYPE a_BlockType, bool a_IncludeFrozenWater = false) { - return ((a_BlockType == E_BLOCK_WATER) || (a_BlockType == E_BLOCK_STATIONARY_WATER)); + if (a_IncludeFrozenWater) + { + return ((a_BlockType == E_BLOCK_WATER) || (a_BlockType == E_BLOCK_STATIONARY_WATER) || (a_BlockType == E_BLOCK_ICE)); + } + else + { + return ((a_BlockType == E_BLOCK_WATER) || (a_BlockType == E_BLOCK_STATIONARY_WATER)); + } } -- cgit v1.2.3 From 0f67f80c6e60b2696bf94ee91330cdc0cefde3fa Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 2 Feb 2014 21:48:21 +0000 Subject: Added IsBlockWaterOrIce() --- src/Defines.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/Defines.h') diff --git a/src/Defines.h b/src/Defines.h index b3dbcc93e..5b868b2e5 100644 --- a/src/Defines.h +++ b/src/Defines.h @@ -254,16 +254,18 @@ inline bool IsValidItem(int a_ItemType) -inline bool IsBlockWater(BLOCKTYPE a_BlockType, bool a_IncludeFrozenWater = false) +inline bool IsBlockWater(BLOCKTYPE a_BlockType) { - if (a_IncludeFrozenWater) - { - return ((a_BlockType == E_BLOCK_WATER) || (a_BlockType == E_BLOCK_STATIONARY_WATER) || (a_BlockType == E_BLOCK_ICE)); - } - else - { - return ((a_BlockType == E_BLOCK_WATER) || (a_BlockType == E_BLOCK_STATIONARY_WATER)); - } + return ((a_BlockType == E_BLOCK_WATER) || (a_BlockType == E_BLOCK_STATIONARY_WATER)); +} + + + + + +inline bool IsBlockWaterOrIce(BLOCKTYPE a_BlockType) +{ + return (IsBlockWater(a_BlockType) || (a_BlockType == E_BLOCK_ICE)); } -- cgit v1.2.3