1
0
cuberite-2a/src/Items/ItemMap.h

37 lines
543 B
C
Raw Normal View History

2014-02-17 09:27:12 -05:00
#pragma once
#include "../Item.h"
2020-04-13 12:38:06 -04:00
class cItemMapHandler:
2014-02-17 09:27:12 -05:00
public cItemHandler
{
2020-04-13 12:38:06 -04:00
using Super = cItemHandler;
2014-02-17 09:27:12 -05:00
static const unsigned int DEFAULT_RADIUS = 128;
2016-02-05 16:45:45 -05:00
2014-02-17 09:27:12 -05:00
public:
2020-04-13 12:38:06 -04:00
cItemMapHandler():
Super(E_ITEM_MAP)
2014-02-17 09:27:12 -05:00
{
}
virtual void OnUpdate(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item) override
2014-02-17 09:27:12 -05:00
{
cMap * Map = a_World->GetMapManager().GetMapData(static_cast<unsigned>(a_Item.m_ItemDamage));
2014-02-17 09:27:12 -05:00
2014-10-20 16:55:07 -04:00
if (Map == nullptr)
2014-02-17 09:27:12 -05:00
{
return;
}
Map->UpdateRadius(*a_Player, DEFAULT_RADIUS);
2014-02-18 13:50:08 -05:00
Map->UpdateClient(a_Player);
2014-02-17 09:27:12 -05:00
}
} ;