diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-02-24 11:28:34 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-02-24 11:28:34 +0100 |
commit | f77720c43f22e347ae9e66302a58b5e3f6a6de58 (patch) | |
tree | 06bb29a7e50aec777969ead2f5ccdf02393c9e1e /src/Items/ItemMap.h | |
parent | Removed an unused member variable from cChunk. (diff) | |
parent | Maps: Improvements (diff) | |
download | cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar.gz cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar.bz2 cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar.lz cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar.xz cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar.zst cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Items/ItemMap.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/Items/ItemMap.h b/src/Items/ItemMap.h new file mode 100644 index 000000000..e8ff9da88 --- /dev/null +++ b/src/Items/ItemMap.h @@ -0,0 +1,43 @@ + +// ItemMap.h + + + + + +#pragma once + +#include "../Entities/Entity.h" +#include "../Item.h" + + + + + +class cItemMapHandler : + public cItemHandler +{ + typedef cItemHandler super; + + static const unsigned int DEFAULT_RADIUS = 128; + +public: + cItemMapHandler() : + super(E_ITEM_MAP) + { + } + + virtual void OnUpdate(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item) + { + cMap * Map = a_World->GetMapManager().GetMapData(a_Item.m_ItemDamage); + + if (Map == NULL) + { + return; + } + + Map->UpdateRadius(*a_Player, DEFAULT_RADIUS); + + Map->UpdateClient(a_Player); + } +} ; |