1
0

Slight formatting tuneup to the previous commit.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1003 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2012-10-22 18:04:15 +00:00
parent 793ae5359d
commit 331d012849

View File

@ -17,6 +17,7 @@ public:
{ {
} }
virtual void PlaceBlock(cWorld * a_World, cPlayer * a_Player, NIBBLETYPE a_BlockMeta, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Dir) override virtual void PlaceBlock(cWorld * a_World, cPlayer * a_Player, NIBBLETYPE a_BlockMeta, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Dir) override
{ {
a_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, m_BlockType, cVine::DirectionToMetaData(a_Dir)); a_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, m_BlockType, cVine::DirectionToMetaData(a_Dir));
@ -27,17 +28,18 @@ public:
virtual bool CanBePlacedAt(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Dir) override virtual bool CanBePlacedAt(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Dir) override
{ {
if ( if (
(a_World->GetBlock( a_BlockX, a_BlockY+1, a_BlockZ ) == E_BLOCK_VINES) && (a_World->GetBlock( a_BlockX, a_BlockY + 1, a_BlockZ ) == E_BLOCK_VINES) &&
(cVine::MetaDataToDirection(a_World->GetBlockMeta( a_BlockX, a_BlockY+1, a_BlockZ )) == a_Dir) (cVine::MetaDataToDirection(a_World->GetBlockMeta( a_BlockX, a_BlockY + 1, a_BlockZ )) == a_Dir)
) )
{ {
return true; return true;
} }
if ((a_World->GetBlock( a_BlockX, a_BlockY+1, a_BlockZ ) != E_BLOCK_AIR)) if ((a_World->GetBlock( a_BlockX, a_BlockY + 1, a_BlockZ ) != E_BLOCK_AIR))
{ {
AddDirection( a_BlockX, a_BlockY, a_BlockZ, a_Dir, true ); AddDirection( a_BlockX, a_BlockY, a_BlockZ, a_Dir, true );
if(a_World->GetBlock( a_BlockX, a_BlockY, a_BlockZ ) == E_BLOCK_AIR){ if (a_World->GetBlock( a_BlockX, a_BlockY, a_BlockZ ) == E_BLOCK_AIR)
{
AddDirection( a_BlockX, a_BlockY, a_BlockZ, a_Dir, false ); AddDirection( a_BlockX, a_BlockY, a_BlockZ, a_Dir, false );
a_World->FastSetBlock( a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_VINES, 0); a_World->FastSetBlock( a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_VINES, 0);
} }
@ -56,6 +58,7 @@ public:
return CanBePlacedAt(a_World, a_BlockX, a_BlockY, a_BlockZ, Dir); return CanBePlacedAt(a_World, a_BlockX, a_BlockY, a_BlockZ, Dir);
} }
virtual bool DoesIgnoreBuildCollision(void) override virtual bool DoesIgnoreBuildCollision(void) override
{ {
return true; return true;