mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-23 04:26:31 -04:00
Merge e569328f3d4f3349331ec30d6b7a5be939ac1ab6 into 49be5b6405d6ab427e06ed350cf76c715a1f3bdd
This commit is contained in:
commit
7c4a8e762e
@ -270,6 +270,19 @@ void ItemFunctions::SendItemUse(unsigned short pid) noexcept
|
|||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ItemFunctions::SetUsedItem(unsigned short pid, const char* refId) noexcept
|
||||||
|
{
|
||||||
|
Player* player;
|
||||||
|
GET_PLAYER(pid, player, false);
|
||||||
|
for (int slot = 0; slot < MWWorld::InventoryStore::Slots; slot++) {
|
||||||
|
if (Misc::StringUtils::ciEqual(player->equipmentItems[slot].refId, refId)) {
|
||||||
|
player->usedItem = player->equipmentItems[slot];
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// All methods below are deprecated versions of methods from above
|
// All methods below are deprecated versions of methods from above
|
||||||
|
|
||||||
void ItemFunctions::InitializeInventoryChanges(unsigned short pid) noexcept
|
void ItemFunctions::InitializeInventoryChanges(unsigned short pid) noexcept
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
{"SendEquipment", ItemFunctions::SendEquipment},\
|
{"SendEquipment", ItemFunctions::SendEquipment},\
|
||||||
{"SendInventoryChanges", ItemFunctions::SendInventoryChanges},\
|
{"SendInventoryChanges", ItemFunctions::SendInventoryChanges},\
|
||||||
{"SendItemUse", ItemFunctions::SendItemUse},\
|
{"SendItemUse", ItemFunctions::SendItemUse},\
|
||||||
|
{"SetUsedItem", ItemFunctions::SetUsedItem},\
|
||||||
\
|
\
|
||||||
{"InitializeInventoryChanges", ItemFunctions::InitializeInventoryChanges},\
|
{"InitializeInventoryChanges", ItemFunctions::InitializeInventoryChanges},\
|
||||||
{"AddItem", ItemFunctions::AddItem}
|
{"AddItem", ItemFunctions::AddItem}
|
||||||
@ -312,6 +313,15 @@ public:
|
|||||||
*/
|
*/
|
||||||
static void SendItemUse(unsigned short pid) noexcept;
|
static void SendItemUse(unsigned short pid) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Update a player's recorded usedItem. Only usable on equipped items.
|
||||||
|
*
|
||||||
|
* \param pid The player ID affected.
|
||||||
|
* \param refId The name of the equipped item.
|
||||||
|
* \return bool
|
||||||
|
*/
|
||||||
|
static bool SetUsedItem(unsigned short pid, const char* refId) noexcept;
|
||||||
|
|
||||||
// All methods below are deprecated versions of methods from above
|
// All methods below are deprecated versions of methods from above
|
||||||
|
|
||||||
static void InitializeInventoryChanges(unsigned short pid) noexcept;
|
static void InitializeInventoryChanges(unsigned short pid) noexcept;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user