1
0

Fixed sign and lever rotations.

This commit is contained in:
madmaxoft 2014-06-22 21:51:34 +02:00
parent 82dcc0b4db
commit d61ff4da3b
2 changed files with 9 additions and 8 deletions

View File

@ -7,12 +7,13 @@
class cBlockLeverHandler : class cBlockLeverHandler :
public cMetaRotator<cBlockHandler, 0x07, 0x04, 0x02, 0x03, 0x01, false> public cMetaRotator<cBlockHandler, 0x07, 0x04, 0x01, 0x03, 0x02, false>
{ {
typedef cMetaRotator<cBlockHandler, 0x07, 0x04, 0x02, 0x03, 0x01, false> super; typedef cMetaRotator<cBlockHandler, 0x07, 0x04, 0x01, 0x03, 0x02, false> super;
public: public:
cBlockLeverHandler(BLOCKTYPE a_BlockType) cBlockLeverHandler(BLOCKTYPE a_BlockType) :
: cMetaRotator<cBlockHandler, 0x07, 0x04, 0x02, 0x03, 0x01, false>(a_BlockType) super(a_BlockType)
{ {
} }
@ -132,7 +133,7 @@ public:
case 0x05: return 0x06; // Ground rotation case 0x05: return 0x06; // Ground rotation
case 0x06: return 0x05; case 0x06: return 0x05;
default: return super::MetaRotateCCW(a_Meta); // Wall Rotation default: return super::MetaRotateCW(a_Meta); // Wall Rotation
} }
} }
} ; } ;

View File

@ -75,13 +75,13 @@ public:
virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override
{ {
return (++a_Meta) & 0x0F; return (a_Meta + 4) & 0x0f;
} }
virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override
{ {
return (--a_Meta) & 0x0F; return (a_Meta + 12) & 0x0f;
} }
virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) override virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) override
@ -90,7 +90,7 @@ public:
// There are 16 meta values which correspond to different directions. // There are 16 meta values which correspond to different directions.
// These values are equated to angles on a circle; 0x08 = 180 degrees. // These values are equated to angles on a circle; 0x08 = 180 degrees.
return (a_Meta < 0x08) ? 0x08 + a_Meta : 0x08 - a_Meta; return (a_Meta < 0x08) ? (0x08 + a_Meta) : (0x08 - a_Meta);
} }