2013-01-11 20:46:01 -08:00
|
|
|
|
2012-07-15 13:36:34 -07:00
|
|
|
#pragma once
|
|
|
|
|
2012-09-23 15:09:57 -07:00
|
|
|
#include "ItemHandler.h"
|
|
|
|
#include "../World.h"
|
|
|
|
#include "../Player.h"
|
2012-07-15 13:36:34 -07:00
|
|
|
|
2013-01-11 20:46:01 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cItemLighterHandler :
|
|
|
|
public cItemHandler
|
2012-07-15 13:36:34 -07:00
|
|
|
{
|
|
|
|
public:
|
2013-01-11 20:46:01 -08:00
|
|
|
cItemLighterHandler(int a_ItemType) :
|
|
|
|
cItemHandler(a_ItemType)
|
2012-07-15 13:36:34 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-05-19 11:22:37 -07:00
|
|
|
virtual bool OnItemUse(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace) override
|
2012-07-15 13:36:34 -07:00
|
|
|
{
|
2013-01-11 20:46:01 -08:00
|
|
|
if (a_BlockFace < 0)
|
2012-10-18 12:41:29 -07:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-07-15 13:36:34 -07:00
|
|
|
a_Player->UseEquippedItem();
|
|
|
|
|
2013-01-11 20:46:01 -08:00
|
|
|
AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace);
|
2012-07-15 13:36:34 -07:00
|
|
|
|
2013-05-19 11:22:37 -07:00
|
|
|
a_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_FIRE, 0); //0 -> new fire
|
2012-07-15 13:36:34 -07:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2013-01-11 20:46:01 -08:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-15 13:36:34 -07:00
|
|
|
|