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

34 lines
530 B
C
Raw Normal View History

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