From f2b7b220a4ed2f5aa2e87792aff99715e113eefa Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 17 Sep 2013 20:57:35 +0100 Subject: Fixed undead burning (c'mon xoft, test ya code :P) --- source/Mobs/Monster.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/Mobs/Monster.h b/source/Mobs/Monster.h index 82fc4b6fc..484e32c65 100644 --- a/source/Mobs/Monster.h +++ b/source/Mobs/Monster.h @@ -110,7 +110,7 @@ public: void SetSightDistance(float sd); /// Sets whether the mob burns in daylight. Only evaluated at next burn-decision tick - void SetBurnsInDaylight(bool a_BurnsInDaylight) { a_BurnsInDaylight = a_BurnsInDaylight; } + void SetBurnsInDaylight(bool a_BurnsInDaylight) { m_BurnsInDaylight = a_BurnsInDaylight; } enum MState{ATTACKING, IDLE, CHASING, ESCAPING} m_EMState; enum MPersonality{PASSIVE,AGGRESSIVE,COWARDLY} m_EMPersonality; -- cgit v1.2.3 From a3a3a6ebe6bc7f861f08922754aa986505f56756 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 17 Sep 2013 20:59:36 +0100 Subject: Added wood directions + Added wood directions --- source/Blocks/BlockWood.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'source') diff --git a/source/Blocks/BlockWood.h b/source/Blocks/BlockWood.h index 4e2246506..dd4544586 100644 --- a/source/Blocks/BlockWood.h +++ b/source/Blocks/BlockWood.h @@ -15,6 +15,51 @@ public: { } + + virtual bool GetPlacementBlockTypeMeta( + cWorld * a_World, cPlayer * a_Player, + int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, + int a_CursorX, int a_CursorY, int a_CursorZ, + BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta + ) override + { + a_BlockType = m_BlockType; + NIBBLETYPE Meta = a_Player->GetEquippedItem().m_ItemDamage; + a_BlockMeta = BlockFaceToMetaData(a_BlockFace, Meta); + return true; + } + + + inline static NIBBLETYPE BlockFaceToMetaData(char a_BlockFace, NIBBLETYPE a_WoodMeta) + { + switch (a_BlockFace) + { + case BLOCK_FACE_YM: + case BLOCK_FACE_YP: + { + return a_WoodMeta; // Top or bottom, just return original + } + + case BLOCK_FACE_ZP: + case BLOCK_FACE_ZM: + { + return a_WoodMeta | 0x8; // North or south + } + + case BLOCK_FACE_XP: + case BLOCK_FACE_XM: + { + return a_WoodMeta | 0x4; // East or west + } + + default: + { + ASSERT(!"Unhandled block face!"); + return a_WoodMeta | 0xC; // No idea, give a special meta (all sides bark) + } + } + } + virtual const char * GetStepSound(void) override { -- cgit v1.2.3 From ab696c37c31dacb4bf830d71050a88659dc97946 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 17 Sep 2013 21:22:26 +0100 Subject: Snow now supports meta values Fixes #98 --- source/Blocks/BlockSnow.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/Blocks/BlockSnow.h b/source/Blocks/BlockSnow.h index bdd9f0b87..b8d48362c 100644 --- a/source/Blocks/BlockSnow.h +++ b/source/Blocks/BlockSnow.h @@ -15,8 +15,28 @@ public: : cBlockHandler(a_BlockType) { } - - + + + virtual bool GetPlacementBlockTypeMeta( + cWorld * a_World, cPlayer * a_Player, + int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, + int a_CursorX, int a_CursorY, int a_CursorZ, + BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta + ) override + { + a_BlockType = m_BlockType; + NIBBLETYPE Meta = a_World->GetBlockMeta(Vector3i(a_BlockX, a_BlockY, a_BlockZ)); + + if ((Meta < 7) && (Meta != 0)) // Is height at maximum (7) or at mininum (0)? Don't do anything if so + { + Meta++; + } + + a_BlockMeta = Meta; + return true; + } + + virtual bool DoesIgnoreBuildCollision(void) override { return true; -- cgit v1.2.3