mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
Keep track of player item
This commit is contained in:
parent
467b3cf4c1
commit
91d1186cbb
5 changed files with 28 additions and 1 deletions
10
src/player.h
10
src/player.h
|
@ -105,6 +105,15 @@ public:
|
|||
snprintf(m_name, PLAYERNAME_SIZE, "%s", name);
|
||||
}
|
||||
|
||||
virtual void wieldItem(u16 item);
|
||||
virtual const InventoryItem *getWieldItem() const
|
||||
{
|
||||
const InventoryList *list = inventory.getList("main");
|
||||
if (list)
|
||||
return list->getItem(m_selected_item);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char * getName()
|
||||
{
|
||||
return m_name;
|
||||
|
@ -146,6 +155,7 @@ public:
|
|||
|
||||
protected:
|
||||
char m_name[PLAYERNAME_SIZE];
|
||||
u16 m_selected_item;
|
||||
f32 m_pitch;
|
||||
f32 m_yaw;
|
||||
v3f m_speed;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue