From 9dc0e3c2335fa6aacd0974b161bd96772639bf52 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 29 Jul 2012 12:07:22 +0000 Subject: Fixed warnings in item handlers - items' damage value is a short, but block meta is only a NIBBLETYPE. Also slight cleanup. git-svn-id: http://mc-server.googlecode.com/svn/trunk@704 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/items/ItemSapling.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'source/items/ItemSapling.h') diff --git a/source/items/ItemSapling.h b/source/items/ItemSapling.h index 23894b812..7edbc76c9 100644 --- a/source/items/ItemSapling.h +++ b/source/items/ItemSapling.h @@ -1,8 +1,12 @@ + #pragma once #include "Item.h" + + + class cItemSaplingHandler : public cItemHandler { public: @@ -12,9 +16,13 @@ public: } - virtual NIBBLETYPE GetBlockMeta(NIBBLETYPE a_ItemMeta) override + virtual NIBBLETYPE GetBlockMeta(short a_ItemDamage) override { - //Only the first 2 bits are important - return a_ItemMeta & 3; + // Only the lowest 3 bits are important + return (NIBBLETYPE)(a_ItemDamage & 0x07); } -}; \ No newline at end of file +} ; + + + + -- cgit v1.2.3